-
-
Notifications
You must be signed in to change notification settings - Fork 10
fix(error-reporting): silence ValidationError from Sentry #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -298,12 +298,17 @@ | |
| expect(classifySilenced(err)).toBeNull(); | ||
| }); | ||
|
|
||
| test("silences ValidationError (user input mistake)", () => { | ||
| expect(classifySilenced(new ValidationError("bad"))).toBe( | ||
| "validation_error" | ||
| ); | ||
| }); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broken ValidationError tagging testsMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit a8418f9. Configure here. |
||
| test.each([ | ||
| [ | ||
| "ResolutionError", | ||
| new ResolutionError("Project 'x'", "not found", "sentry issue list"), | ||
| ], | ||
| ["ValidationError", new ValidationError("bad")], | ||
| ["SeerError", new SeerError("not_enabled")], | ||
| ["ConfigError", new ConfigError("bad")], | ||
| ["generic Error", new Error("boom")], | ||
|
|
@@ -473,7 +478,7 @@ | |
|
|
||
| test("ValidationError with field uses field as kind", () => { | ||
| const { tags } = capturedScopeTags(new ValidationError("Bad", "trace_id")); | ||
| expect(tags["cli_error.class"]).toBe("ValidationError"); | ||
|
Check failure on line 481 in test/lib/error-reporting.test.ts
|
||
| expect(tags["cli_error.kind"]).toBe("trace_id"); | ||
| }); | ||
|
|
||
|
|
@@ -484,7 +489,7 @@ | |
| 'Invalid trace ID "d2ad4a2d947b5983". Expected 32-char hex.' | ||
| ); | ||
| const { tags } = capturedScopeTags(err); | ||
| expect(tags["cli_error.class"]).toBe("ValidationError"); | ||
|
Check failure on line 492 in test/lib/error-reporting.test.ts
|
||
| expect(tags["cli_error.kind"]).toBe("Invalid trace ID"); | ||
| }); | ||
|
|
||
|
|
@@ -505,7 +510,7 @@ | |
| const eventErr = capturedScopeTags( | ||
| new ValidationError('Invalid event ID "abc"') | ||
| ).tags; | ||
| expect(traceErr["cli_error.kind"]).not.toBe(eventErr["cli_error.kind"]); | ||
|
Check failure on line 513 in test/lib/error-reporting.test.ts
|
||
| }); | ||
|
|
||
| test("captures ResolutionError", () => { | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Integration tests for
ValidationErrorwill fail because they were not updated to reflect that this error is now silenced inreportCliError, which now returns early before callingSentry.withScope.Severity: LOW
Suggested Fix
Update the four integration tests for
ValidationErrorintest/lib/error-reporting.test.ts(starting around line 479) to align with the new behavior. These tests should either be removed or modified to assert thatValidationErroris correctly silenced and thatSentry.withScopeis not called.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.