From 6a72354a9c9daaeb957bfa98c2c2202173f4762e Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Fri, 27 Sep 2024 08:41:55 -0700 Subject: [PATCH] [telemetry] Don't log user errors (#2305) ## 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 https://github.com/jetify-com/devbox/pull/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 --- internal/boxcli/midcobra/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/boxcli/midcobra/telemetry.go b/internal/boxcli/midcobra/telemetry.go index b275d71b8ab..45aa2b7538b 100644 --- a/internal/boxcli/midcobra/telemetry.go +++ b/internal/boxcli/midcobra/telemetry.go @@ -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 }