Skip to content

Commit

Permalink
[telemetry] Don't log user errors (#2305)
Browse files Browse the repository at this point in the history
## Summary

We're running out of Sentry events and it looks like the culprit is
devbox overlogging, including a lot of user errors that should not be
logged.

This PR #844 removed code that
avoided logging user errors. I think this was a bug? If programmer wants
a user error to be logged, they should use `WithLoggedUserMessage`
instead.

## How was it tested?

Untested
  • Loading branch information
mikeland73 committed Sep 27, 2024
1 parent 57312c0 commit 6a72354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/boxcli/midcobra/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (m *telemetryMiddleware) postRun(cmd *cobra.Command, args []string, runErr
defer telemetry.Stop()

var userExecErr *usererr.ExitError
if errors.As(runErr, &userExecErr) {
if errors.As(runErr, &userExecErr) || !usererr.ShouldLogError(runErr) {
return
}

Expand Down

0 comments on commit 6a72354

Please sign in to comment.