Skip to content

Commit

Permalink
modify error handling in FindAllStackConfigsInPathsForSt (#726)
Browse files Browse the repository at this point in the history
Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
haitham911 and aknysh authored Oct 16, 2024
1 parent a9b64ef commit a94f9f6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/config/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ func FindAllStackConfigsInPathsForStack(
// TODO: review `doublestar` library
matches, err = u.GetGlobMatches(pathWithExt)
if err != nil {
y, _ := u.ConvertToYAML(cliConfig)
return nil, nil, false, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y)
if cliConfig.Logs.Level == u.LogLevelTrace {
y, _ := u.ConvertToYAML(cliConfig)
return nil, nil, false, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y)
}
return nil, nil, false, err
}

}

// Exclude files that match any of the excludePaths
Expand Down Expand Up @@ -118,8 +122,11 @@ func FindAllStackConfigsInPaths(
// TODO: review `doublestar` library
matches, err = u.GetGlobMatches(pathWithExt)
if err != nil {
y, _ := u.ConvertToYAML(cliConfig)
return nil, nil, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y)
if cliConfig.Logs.Level == u.LogLevelTrace {
y, _ := u.ConvertToYAML(cliConfig)
return nil, nil, fmt.Errorf("%v\n\n\nCLI config:\n\n%v", err, y)
}
return nil, nil, err
}
}

Expand Down

0 comments on commit a94f9f6

Please sign in to comment.