Skip to content

Commit a1d4044

Browse files
committed
chore(cli): re-enable Sentry reporting for unclassified errors
Remove the temporary UNCLASSIFIED error code and revert catch-all handlers back to INTERNAL_ERROR (which is Sentry-reportable). This should be merged last, after all CliError classification branches. Made-with: Cursor
1 parent fd585dd commit a1d4044

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export const CliErrorCode = {
1010
ValidationError: "VALIDATION_ERROR",
1111
NetworkError: "NETWORK_ERROR",
1212
AuthError: "AUTH_ERROR",
13-
ConfigError: "CONFIG_ERROR",
14-
Unclassified: "UNCLASSIFIED"
13+
ConfigError: "CONFIG_ERROR"
1514
} as const;
1615

1716
export type CliErrorCode = (typeof CliErrorCode)[keyof typeof CliErrorCode];
@@ -28,8 +27,7 @@ const SENTRY_REPORTABLE: Record<CliErrorCode, boolean> = {
2827
VALIDATION_ERROR: false,
2928
NETWORK_ERROR: false,
3029
AUTH_ERROR: false,
31-
CONFIG_ERROR: false,
32-
UNCLASSIFIED: false
30+
CONFIG_ERROR: false
3331
};
3432

3533
export function shouldReportToSentry(code: CliErrorCode): boolean {
@@ -49,8 +47,7 @@ function isNodeVersionError(error: unknown): boolean {
4947
/**
5048
* Resolves the effective error code: explicit override wins,
5149
* then auto-detects from known error types,
52-
* and falls back to UNCLASSIFIED for unknown errors until all packages
53-
* are migrated to the new error system.
50+
* and falls back to INTERNAL_ERROR for truly unknown errors.
5451
*/
5552
export function resolveErrorCode(error: unknown, explicitCode?: CliErrorCode): CliErrorCode {
5653
if (explicitCode != null) {
@@ -65,7 +62,7 @@ export function resolveErrorCode(error: unknown, explicitCode?: CliErrorCode): C
6562
if (isNodeVersionError(error)) {
6663
return "ENVIRONMENT_ERROR";
6764
}
68-
return "UNCLASSIFIED";
65+
return "INTERNAL_ERROR";
6966
}
7067

7168
export class CliError extends Error {

0 commit comments

Comments
 (0)