Skip to content

Commit

Permalink
refactor(config): wrap config file parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
muthukrishnan24 committed Feb 20, 2022
1 parent 4a88507 commit 7252a65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ func Parse(confPath string) (*lint.Config, error) {
confPath = filepath.Clean(confPath)
confBytes, err := os.ReadFile(confPath)
if err != nil {
return nil, err
return nil, fmt.Errorf("config file error: %w", err)
}

conf := &lint.Config{}
err = yaml.UnmarshalStrict(confBytes, conf)
if err != nil {
return nil, err
return nil, fmt.Errorf("config file error: %w", err)
}

if conf.Formatter == "" {
Expand Down

0 comments on commit 7252a65

Please sign in to comment.