Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Fragment, useCallback} from 'react';
import styled from '@emotion/styled';
import * as Sentry from '@sentry/react';

import configureCodeReviewImg from 'sentry-images/spot/seer-config-check.svg';

Expand Down Expand Up @@ -68,6 +69,9 @@ export function ConfigureCodeReviewStep() {
resolve();
},
onError: () => {
Sentry.captureException(
new Error('Seer Onboarding: Unable to enable code review')
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

reject(new Error(t('Failed to enable AI Code Review')));
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Fragment, useCallback, useState} from 'react';
import styled from '@emotion/styled';
import * as Sentry from '@sentry/react';

import defaultsImg from 'sentry-images/spot/seer-config-error.svg';

Expand Down Expand Up @@ -72,6 +73,9 @@ export function ConfigureDefaultsStep() {
setCurrentStep(currentStep + 1);
},
onError: () => {
Sentry.captureException(
new Error('Seer Onboarding: Unable to update defaults')
);
addErrorMessage(
t('Failed to update Seer default settings, reload and try again')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export function ConfigureRootCauseAnalysisStep() {
setCurrentStep(currentStep + 1);
},
onError: () => {
Sentry.captureException(new Error('Seer Onboarding: Unable to update autofix'));
addErrorMessage(t('Failed to save settings'));
},
}
Expand Down
Loading