Repository navigation
Conversation
sentry-for-ai plugins will send `X-Sentry-Plugin` and `X-Sentry-Plugin-Version` (getsentry/sentry-for-ai#372). Record them as `app.plugin.name` and `app.plugin.version` on the same spans and metrics as `app.utm_source`, so we can break plugin usage down by distribution and release. Unknown names become `other`. Versions keep `X.Y.Z`; prereleases become `dev`, anything else `other`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
wedamija
marked this pull request as ready for review
October 19, 2026 19:32
joshuawayzwright
pushed a commit
to joshuawayzwright/sentry-mcp
that referenced
this pull request
Nov 16, 2026
…, url-parser) (getsentry#1580) ## Summary Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to surface errors that were previously swallowed silently. Each fix follows the project's established pattern from AGENTS.md and the `no-silent-catch` Biome plugin (getsentry#1531). ## Changes ### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()` **Root cause:** When `listOrganizations()` fails during team resolution (used by `project create` and `init`), the error was silently swallowed. Users got a generic fallback hint with no indication of what went wrong (expired token, network issue, 403, etc.). **Reproduction:** Any scenario where `listOrganizations()` fails during team resolution — e.g., run `sentry project create` with an expired token. **Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and remove the `biome-ignore` comment. ### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()` **Root cause:** When `parseOrgProjectArg` threw on a malformed target string during trace ID recovery, the error was silently swallowed and recovery proceeded with empty context. This hid parse errors that could help debug user input issues in `trace view`, `span view`, `span list`. **Reproduction:** Run `sentry trace view --h/nothex` — the slug validation error from `parseOrgProjectArg` is silently swallowed. **Fix:** Add `log.debug("Failed to parse target arg for recovery context", error)`, promote the logger to module scope, and rename the shadowed local in `warnIfNormalized` to fix the `noShadow` lint error. ### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()` **Root cause:** When a URL-looking string (starts with `http://` or `https://`) failed to parse via `new URL()`, the error was silently swallowed. This function is used by dashboard, event, trace, and other commands to detect pasted Sentry URLs. **Reproduction:** Pass a malformed URL like `https://[invalid` to any command that accepts Sentry URLs. **Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove the `biome-ignore` comment. ## Testing - All existing tests pass (resolve-team: 1 test, trace-target: 19 tests, sentry-url-parser: 84 tests) - Lint passes clean (`biome check` — 0 errors) <div><a href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Miguel Betegón <[email protected]>
joshuawayzwright
pushed a commit
to joshuawayzwright/sentry-mcp
that referenced
this pull request
Nov 16, 2026
…, url-parser) (getsentry#1580) ## Summary Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to surface errors that were previously swallowed silently. Each fix follows the project's established pattern from AGENTS.md and the `no-silent-catch` Biome plugin (getsentry#1531). ## Changes ### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()` **Root cause:** When `listOrganizations()` fails during team resolution (used by `project create` and `init`), the error was silently swallowed. Users got a generic fallback hint with no indication of what went wrong (expired token, network issue, 403, etc.). **Reproduction:** Any scenario where `listOrganizations()` fails during team resolution — e.g., run `sentry project create` with an expired token. **Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and remove the `biome-ignore` comment. ### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()` **Root cause:** When `parseOrgProjectArg` threw on a malformed target string during trace ID recovery, the error was silently swallowed and recovery proceeded with empty context. This hid parse errors that could help debug user input issues in `trace view`, `span view`, `span list`. **Reproduction:** Run `sentry trace view --h/nothex` — the slug validation error from `parseOrgProjectArg` is silently swallowed. **Fix:** Add `log.debug("Failed to parse target arg for recovery context", error)`, promote the logger to module scope, and rename the shadowed local in `warnIfNormalized` to fix the `noShadow` lint error. ### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()` **Root cause:** When a URL-looking string (starts with `http://` or `https://`) failed to parse via `new URL()`, the error was silently swallowed. This function is used by dashboard, event, trace, and other commands to detect pasted Sentry URLs. **Reproduction:** Pass a malformed URL like `https://[invalid` to any command that accepts Sentry URLs. **Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove the `biome-ignore` comment. ## Testing - All existing tests pass (resolve-team: 1 test, trace-target: 19 tests, sentry-url-parser: 84 tests) - Lint passes clean (`biome check` — 0 errors) <div><a href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Miguel Betegón <[email protected]>
joshuawayzwright
pushed a commit
to joshuawayzwright/sentry-mcp
that referenced
this pull request
Nov 16, 2026
…, url-parser) (getsentry#1580) ## Summary Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to surface errors that were previously swallowed silently. Each fix follows the project's established pattern from AGENTS.md and the `no-silent-catch` Biome plugin (getsentry#1531). ## Changes ### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()` **Root cause:** When `listOrganizations()` fails during team resolution (used by `project create` and `init`), the error was silently swallowed. Users got a generic fallback hint with no indication of what went wrong (expired token, network issue, 403, etc.). **Reproduction:** Any scenario where `listOrganizations()` fails during team resolution — e.g., run `sentry project create` with an expired token. **Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and remove the `biome-ignore` comment. ### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()` **Root cause:** When `parseOrgProjectArg` threw on a malformed target string during trace ID recovery, the error was silently swallowed and recovery proceeded with empty context. This hid parse errors that could help debug user input issues in `trace view`, `span view`, `span list`. **Reproduction:** Run `sentry trace view --h/nothex` — the slug validation error from `parseOrgProjectArg` is silently swallowed. **Fix:** Add `log.debug("Failed to parse target arg for recovery context", error)`, promote the logger to module scope, and rename the shadowed local in `warnIfNormalized` to fix the `noShadow` lint error. ### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()` **Root cause:** When a URL-looking string (starts with `http://` or `https://`) failed to parse via `new URL()`, the error was silently swallowed. This function is used by dashboard, event, trace, and other commands to detect pasted Sentry URLs. **Reproduction:** Pass a malformed URL like `https://[invalid` to any command that accepts Sentry URLs. **Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove the `biome-ignore` comment. ## Testing - All existing tests pass (resolve-team: 1 test, trace-target: 19 tests, sentry-url-parser: 84 tests) - Lint passes clean (`biome check` — 0 errors) <div><a href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Miguel Betegón <[email protected]>
This branch was successfully deployed
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.
sentry-for-ai plugins will send
X-Sentry-PluginandX-Sentry-Plugin-Version(getsentry/sentry-for-ai#372). Record them asapp.plugin.nameandapp.plugin.versionon the same spans and metrics asapp.utm_source, so we can break plugin usage down by distribution and release.Unknown names become
other. Versions keepX.Y.Z; prereleases becomedev, anything elseother.