Skip to content

Commit

Permalink
feat: print all errors in dev reader
Browse files Browse the repository at this point in the history
  • Loading branch information
dundee committed Dec 5, 2024
1 parent 4f863ef commit 0087fc8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/env/readers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ func devReader(fallback cfg.Reader) cfg.Reader { //nolint:deadcode,unused // Why
break
}
if len(errors) != 0 {
return fallback(fileName)
cfgData, err := fallback(fileName)
if err != nil {
// print all errors
for _, e := range errors {
fmt.Printf("failed to read config file %q: %v\n", fileName, e)
}
return nil, fmt.Errorf("failed to read config file %q: %w", fileName, err)
}
return cfgData, nil
}

return b, nil
Expand Down

0 comments on commit 0087fc8

Please sign in to comment.