@@ -80,22 +80,22 @@ func ValidatePathInDirectory(path, allowedDir string) (string, error) {
8080func loadConfig (path string ) (* latest.Config , error ) {
8181 data , err := os .ReadFile (path )
8282 if err != nil {
83- return nil , fmt .Errorf ("failed to read config file: %w" , err )
83+ return nil , fmt .Errorf ("reading config file: %w" , err )
8484 }
8585
8686 var raw map [string ]any
8787 if err := yaml .Unmarshal (data , & raw ); err != nil {
88- return nil , fmt .Errorf ("failed to parse config file %s: %w " , path , err )
88+ return nil , fmt .Errorf ("parsing config file %s\n %s " , path , yaml . FormatError ( err , true , true ) )
8989 }
9090
9191 oldConfig , err := parseCurrentVersion (data , raw ["version" ])
9292 if err != nil {
93- return nil , fmt .Errorf ("failed to parse config file %s: %w " , path , err )
93+ return nil , fmt .Errorf ("parsing config file %s\n %s " , path , yaml . FormatError ( err , true , true ) )
9494 }
9595
9696 config , err := migrateToLatestConfig (oldConfig )
9797 if err != nil {
98- return nil , fmt .Errorf ("failed to migrate config: %w" , err )
98+ return nil , fmt .Errorf ("migrating config: %w" , err )
9999 }
100100
101101 if err := validateConfig (& config ); err != nil {
0 commit comments