-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix(telemetry): capture command errors to Sentry #145
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
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 |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| // biome-ignore lint/performance/noNamespaceImport: Sentry SDK recommends namespace import | ||
| import * as Sentry from "@sentry/bun"; | ||
| import { | ||
| type ApplicationText, | ||
| buildApplication, | ||
|
|
@@ -11,7 +13,6 @@ import { helpCommand } from "./commands/help.js"; | |
| import { issueRoute } from "./commands/issue/index.js"; | ||
| import { orgRoute } from "./commands/org/index.js"; | ||
| import { projectRoute } from "./commands/project/index.js"; | ||
|
|
||
| import { CLI_VERSION } from "./lib/constants.js"; | ||
| import { CliError, getExitCode } from "./lib/errors.js"; | ||
| import { error as errorColor } from "./lib/formatters/colors.js"; | ||
|
|
@@ -45,6 +46,10 @@ export const routes = buildRouteMap({ | |
| const customText: ApplicationText = { | ||
| ...text_en, | ||
| exceptionWhileRunningCommand: (exc: unknown, ansiColor: boolean): string => { | ||
| // Report all command errors to Sentry. Stricli catches exceptions and doesn't | ||
| // re-throw, so we must capture here to get visibility into command failures. | ||
| Sentry.captureException(exc); | ||
|
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. Expected user errors reported to Sentry as bugsMedium Severity The |
||
|
|
||
| if (exc instanceof CliError) { | ||
| const prefix = ansiColor ? errorColor("Error:") : "Error:"; | ||
| return `${prefix} ${exc.format()}`; | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.