Skip to content

Commit

Permalink
make the stop file error better
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Jan 9, 2024
1 parent 6dbbc61 commit 1ccc268
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/osutil/osutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func GetAbsoluteFolderPath(folder string) (string, error) {

const (
DEFAULT_STOP_FILE_NAME = ".root_dir"
ErrStopFileNotFoundWithinLimit = "stop file not found within limit"
ErrStopFileNotFoundWithinLimit = "stop file not found in any parent directory within limit"
)

// FindFile looks for given file in the current directory and its parent directories first by locating
Expand Down Expand Up @@ -142,7 +142,7 @@ func findTopParentFolderWithLimit(startDir, stopFileName string, limit int) (str
currentDir = parentDir
}

return "", errors.New(ErrStopFileNotFoundWithinLimit)
return "", fmt.Errorf("%s: %s", ErrStopFileNotFoundWithinLimit, stopFileName)
}

func findFileInSubfolders(startDir, targetFileName string) (string, error) {
Expand Down

0 comments on commit 1ccc268

Please sign in to comment.