From 05ce6e8bb25a64902865f0ffb70f49b7fb9bea14 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:40:47 +0000 Subject: [PATCH] fix(telemetry): Silence CliError for process exit code 1 --- packages/cli/src/lib/error-reporting.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/lib/error-reporting.ts b/packages/cli/src/lib/error-reporting.ts index a44c98596..ff4f22730 100644 --- a/packages/cli/src/lib/error-reporting.ts +++ b/packages/cli/src/lib/error-reporting.ts @@ -54,7 +54,8 @@ type SilenceReason = | "output_error" | "auth_expected" | "api_user_error" - | "network_error"; + | "network_error" + | "process_exit"; /** * Classify whether an error should be silenced. @@ -94,6 +95,16 @@ export function classifySilenced(error: unknown): SilenceReason | null { if (error instanceof ApiError && error.status > 400 && error.status < 500) { return "api_user_error"; } + // A child process launched by `sentry local run` or `sentry monitor run` + // that exits with a non-zero code throws `CliError("Process exited with + // code N")`. These are expected user-script failures, not CLI bugs — no + // actionable signal comes from capturing them (CLI-20G). + if ( + error instanceof CliError && + error.message.startsWith("Process exited with code") + ) { + return "process_exit"; + } // A 400 (Bad Request) signals a malformed request the CLI built — a code // defect — so it is always captured. A user's unparseable `--query` is NOT a // 400 here: it is converted to a ValidationError at the command boundary