Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/app.ts
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,
Expand All @@ -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";
Expand Down Expand Up @@ -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);
Copy link

Choose a reason for hiding this comment

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

Expected user errors reported to Sentry as bugs

Medium Severity

The Sentry.captureException(exc) call reports all exceptions to Sentry, including expected CliError instances like authentication failures, validation errors, and missing context errors. These are user-facing errors by design (they have custom format() methods for friendly display), not bugs that need tracking. This will flood Sentry with noise and make actual bugs harder to identify. The capture call needs to exclude CliError instances.

Fix in Cursor Fix in Web


if (exc instanceof CliError) {
const prefix = ansiColor ? errorColor("Error:") : "Error:";
return `${prefix} ${exc.format()}`;
Expand Down
Loading