Skip to content

Commit 68c2b60

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 b417f13 commit 68c2b60

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export namespace CliError {
5757
ValidationError: "VALIDATION_ERROR",
5858
NetworkError: "NETWORK_ERROR",
5959
AuthError: "AUTH_ERROR",
60-
ConfigError: "CONFIG_ERROR"
60+
ConfigError: "CONFIG_ERROR",
61+
Unclassified: "UNCLASSIFIED"
6162
} as const;
6263
}
6364

@@ -73,7 +74,8 @@ const SENTRY_REPORTABLE: Record<CliError.Code, boolean> = {
7374
VALIDATION_ERROR: false,
7475
NETWORK_ERROR: false,
7576
AUTH_ERROR: false,
76-
CONFIG_ERROR: false
77+
CONFIG_ERROR: false,
78+
UNCLASSIFIED: false
7779
};
7880

7981
export function shouldReportToSentry(code: CliError.Code): boolean {
@@ -93,7 +95,8 @@ function isNodeVersionError(error: unknown): boolean {
9395
/**
9496
* Resolves the effective error code: explicit override wins,
9597
* then auto-detects from known error types,
96-
* and falls back to INTERNAL_ERROR for truly unknown errors.
98+
* and falls back to UNCLASSIFIED for unknown errors until all packages
99+
* are migrated to the new error system.
97100
*/
98101
export function resolveErrorCode(error: unknown, explicitCode?: CliError.Code): CliError.Code {
99102
if (explicitCode != null) {
@@ -108,5 +111,5 @@ export function resolveErrorCode(error: unknown, explicitCode?: CliError.Code):
108111
if (isNodeVersionError(error)) {
109112
return CliError.Code.EnvironmentError;
110113
}
111-
return CliError.Code.InternalError;
114+
return CliError.Code.Unclassified;
112115
}

0 commit comments

Comments
 (0)