Skip to content

Commit

Permalink
Improve error logging for CLI config issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerebrovinny committed Mar 8, 2025
1 parent fdfb3bb commit f8ce952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var RootCmd = &cobra.Command{
if errors.Is(err, config.NotFound) {

Check warning on line 63 in cmd/root.go

View check run for this annotation

Codecov / codecov/patch

cmd/root.go#L63

Added line #L63 was not covered by tests
// For help commands or when help flag is set, we don't want to show the error
if !isHelpRequested {
u.LogWarning(err.Error())
log.Warn("CLI configuration issue", "error", err)

Check warning on line 66 in cmd/root.go

View check run for this annotation

Codecov / codecov/patch

cmd/root.go#L66

Added line #L66 was not covered by tests
}
} else {
u.LogErrorAndExit(err)

Check failure on line 69 in cmd/root.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/root.go#L69

SA1019: u.LogErrorAndExit is deprecated: Use `log.Fatal` instead. This function will be removed in a future release. LogErrorAndExit logs errors to std.Error and exits with an error code (staticcheck)
Raw output
cmd/root.go:69:5: SA1019: u.LogErrorAndExit is deprecated: Use `log.Fatal` instead. This function will be removed in a future release. LogErrorAndExit logs errors to std.Error and exits with an error code (staticcheck)
				u.LogErrorAndExit(err)
				^
Expand Down

0 comments on commit f8ce952

Please sign in to comment.