Skip to content

Commit 6e6d684

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 1ddf93c commit 6e6d684

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
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([
@@ -39,7 +40,8 @@ function isNodeVersionError(error: unknown): boolean {
3940
/**
4041
* Resolves the effective error code: explicit override wins,
4142
* then auto-detects from known error types,
42-
* and falls back to INTERNAL_ERROR for truly unknown errors.
43+
* and falls back to UNCLASSIFIED for unknown errors until all packages
44+
* are migrated to the new error system.
4345
*/
4446
export function resolveErrorCode(error: unknown, explicitCode?: CliError.Code): CliError.Code {
4547
if (explicitCode != null) {
@@ -54,7 +56,7 @@ export function resolveErrorCode(error: unknown, explicitCode?: CliError.Code):
5456
if (isNodeVersionError(error)) {
5557
return "ENVIRONMENT_ERROR";
5658
}
57-
return "INTERNAL_ERROR";
59+
return "UNCLASSIFIED";
5860
}
5961

6062
export class CliError extends Error {

0 commit comments

Comments
 (0)