(props: {
error_name: string;
error_message: string;
stack_trace?: string;
command?: string;
kind: "uncaught_exception" | "unhandled_rejection" | "command_error";
})
| 318 | } |
| 319 | |
| 320 | export function trackCliError(props: { |
| 321 | error_name: string; |
| 322 | error_message: string; |
| 323 | stack_trace?: string; |
| 324 | command?: string; |
| 325 | kind: "uncaught_exception" | "unhandled_rejection" | "command_error"; |
| 326 | }): void { |
| 327 | trackEvent("cli_error", { |
| 328 | error_name: props.error_name, |
| 329 | // Redact before truncating — CLI messages and stack traces carry absolute |
| 330 | // install paths (/Users/...), cache dirs, and user-supplied args. Same |
| 331 | // redaction the render_* events already apply. |
| 332 | error_message: redactTelemetryMessage(props.error_message).slice(0, 1000), |
| 333 | stack_trace: props.stack_trace |
| 334 | ? redactTelemetryMessage(props.stack_trace).slice(0, 2000) |
| 335 | : undefined, |
| 336 | command: props.command, |
| 337 | kind: props.kind, |
| 338 | }); |
| 339 | } |
| 340 | |
| 341 | // Report why a command failed before it exits non-zero. cli_command_result |
| 342 | // records the failure but not the reason; this fills that gap via cli_error so |
no test coverage detected