Skip to content

Commit

Permalink
simplify error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleader committed Jan 5, 2024
1 parent 9d09fc9 commit adf9494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions loadfile/loadfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ func LoadContext(neededFilepaths []string) (map[string][]byte, error) {
for _, filePath := range neededFilepaths {
absPath, err := filepath.Abs(filePath)
if err != nil {
return nil, fmt.Errorf("error loading context files, failed to obtain absolute path of file %s (%w)",
return nil, fmt.Errorf("error obtaining absolute path of file %s (%w)",
filePath, err)
}
fileData, err := os.ReadFile(filepath.Clean(absPath))
if err != nil {
return nil, fmt.Errorf("error loading context files, failed to read file %s (%w)", absPath, err)
return nil, fmt.Errorf("error reading file %s (%w)", absPath, err)
}
result[absPath] = fileData
}
Expand Down

0 comments on commit adf9494

Please sign in to comment.