feat(seer): Capture errors when updating onboarding#107683
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| onError: () => { | ||
| Sentry.captureException( | ||
| new Error('Seer Onboarding: Unable to enable code review') | ||
| ); |
There was a problem hiding this comment.
Error context lost when capturing Sentry exceptions
Low Severity
The onError callback ignores the actual error returned by the mutation and creates a new generic Error instead. The mutation's onError callback receives the real error as its first parameter (as seen in useAutofix.tsx), but these callbacks use () => which discards it. This loses valuable debugging context like HTTP status codes, server error messages, and stack traces. Engineers investigating these errors in Sentry will only see generic messages like "Unable to enable code review" with no information about the actual failure cause.
Additional Locations (2)
| onError: () => { | ||
| Sentry.captureException( | ||
| new Error('Seer Onboarding: Unable to enable code review') | ||
| ); |
There was a problem hiding this comment.
Missing Sentry capture in second error handler
Low Severity
The PR adds Sentry.captureException to the onError handler in updateEnabledCodeReview (line 71) but misses adding it to the similar onError handler in updateUnselectedRepositories (line 99). Both functions are part of the same onboarding step, call the same updateRepositorySettings mutation, and handle the same type of failure. This creates inconsistent error monitoring where failures to enable code review are captured in Sentry, but failures to disable code review for unselected repositories are not.
6f5b0eb to
7663dc8
Compare


Follow up to #107680