Skip to content

Commit 8e60a36

Browse files
committed
chore(cli): temporarily disable Sentry reporting for unclassified errors
Add UNCLASSIFIED code to CliError.Code and use it for catch-all error handlers in cli.ts, CliContext.ts, and withContext.ts. Generic Error instances that are not explicitly classified will no longer be reported to Sentry, reducing noise while we migrate utility packages away from CliError. Made-with: Cursor
1 parent 10c3e19 commit 8e60a36

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/cli/cli-v2/src/context/withContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function reportError(context: Context, error: unknown, options?: { code?:
112112
if (error instanceof TaskAbortSignal) {
113113
return;
114114
}
115-
const code = resolveErrorCode(error, options?.code) ?? "INTERNAL_ERROR";
115+
const code = resolveErrorCode(error, options?.code) ?? "UNCLASSIFIED";
116116
if (shouldReportToSentry(code)) {
117117
context.telemetry.captureException(error, { errorCode: code });
118118
}

packages/cli/cli/src/cli-context/CliContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export class CliContext {
261261
context.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE);
262262
context.failWithoutThrowing(undefined, error, { code: "ENVIRONMENT_ERROR" });
263263
} else {
264-
context.failWithoutThrowing(undefined, error, { code: "INTERNAL_ERROR" });
264+
context.failWithoutThrowing(undefined, error, { code: "UNCLASSIFIED" });
265265
}
266266
throw new TaskAbortSignal();
267267
} finally {

packages/cli/cli/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async function runCli() {
146146
} else if (error instanceof TaskAbortSignal) {
147147
cliContext.failWithoutThrowing();
148148
} else {
149-
cliContext.failWithoutThrowing("Failed.", error, { code: "INTERNAL_ERROR" });
149+
cliContext.failWithoutThrowing("Failed.", error, { code: "UNCLASSIFIED" });
150150
}
151151
}
152152

packages/cli/task-context/src/CliError.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export declare namespace CliError {
1111
| "VALIDATION_ERROR"
1212
| "NETWORK_ERROR"
1313
| "AUTH_ERROR"
14-
| "CONFIG_ERROR";
14+
| "CONFIG_ERROR"
15+
| "UNCLASSIFIED";
1516
}
1617

1718
const SENTRY_REPORTABLE_CODES: ReadonlySet<CliError.Code> = new Set([

0 commit comments

Comments
 (0)