Skip to content

Commit

Permalink
revert back to using logger's handling for stacktracing
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis committed Sep 20, 2022
1 parent cb23d69 commit 3c7e4e2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,14 @@ func Execute() {
if err != nil {
for _, cobraError := range usageErrors {
if strings.HasPrefix(err.Error(), cobraError) {
if cfg.Log.Stacktrace {
log.FeedbackError(ctx, fmt.Sprintf("%+v", err))
} else {
log.FeedbackError(ctx, err.Error())
}
log.FeedbackErrorE(ctx, "Usage error", err)
if usageErr := rootCmd.Usage(); usageErr != nil {
log.FeedbackFatalE(ctx, "error displaying usage help", usageErr)
}
os.Exit(1)
}
}
if cfg.Log.Stacktrace {
log.FeedbackFatal(ctx, fmt.Sprintf("%+v", err))
} else {
log.FeedbackFatal(ctx, err.Error())
}
log.FeedbackFatalE(ctx, "Execution error", err)
}
}

Expand Down

0 comments on commit 3c7e4e2

Please sign in to comment.