Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / cli / classifyError

Function: classifyError()

classifyError(err): ErrorCategory

Defined in: packages/b2c-tooling-sdk/src/cli/base-command.ts:79

Classify a thrown command error for telemetry so analytics can exclude expected validation/guardrail errors from reliability (defect-rate) metrics.

Resolution order:

  1. An explicit oclif code of ERROR_CODE.VALIDATION / GUARDRAIL (set at the throw site via this.error(msg, {code})).
  2. Safety error class names thrown from HTTP/auth middleware that do not flow through this.error (SafetyBlockedError, SafetyConfirmationRequired).
  3. Everything else is a genuine runtime error (the reliability signal).

Parameters

err

unknown

Returns

ErrorCategory

Released under the Apache-2.0 License.