fix(error-reporting): Silence expected ResolutionError for user input - #1362
Draft
sentry[bot] wants to merge 2 commits into
Draft
fix(error-reporting): Silence expected ResolutionError for user input#1362sentry[bot] wants to merge 2 commits into
sentry[bot] wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue CLI-RP by silencing
ResolutionErrors that are a result of expected user input failures, rather than actual CLI bugs.Problem:
When users provide short or non-existent event IDs (e.g.,
sentry event view <org>/<project>/ca0f261fb715), the CLI's hex-ID recovery mechanism correctly identifies that the event cannot be found and throws aResolutionError. However, these errors were being reported to Sentry as issues (over 7,500 occurrences), creating noise, because the error reporting system (classifySilenced) had no way to distinguish these expected user-input errors from genuine CLI defects.Solution:
This fix implements the approach outlined in PR #1115:
packages/cli/src/lib/errors.ts: Added areadonly expected: booleanproperty to theResolutionErrorclass, initialized tofalseby default. To adhere to theuseMaxParamslint rule, anasExpected()fluent method was introduced to mark an error instance as expected post-construction.packages/cli/src/lib/hex-id-recovery.ts: ModifiedbuildRecoveryErrorto call.asExpected()onResolutionErrorinstances generated forno-matches,past-retention, andlooks-like-slugreasons. These are now explicitly marked as expected user-input failures.packages/cli/src/lib/error-reporting.ts: UpdatedclassifySilencedto check if an error is an instance ofResolutionErrorand itsexpectedproperty istrue. If so, it now returns a newuser_input_errorsilence reason, preventing these events from being captured as Sentry issues.Fixes CLI-RP