redactErrorForLogging
function redactErrorForLogging(error: unknown): Record<string, unknown>;Defined in: src/logging/redaction.ts:119
Converts an arbitrary thrown value into a JSON-safe, secret-free record.
Structured SDK errors are serialized through their toJSON() (which already
redacts details); plain errors contribute name/message/stack-free context;
other values are stringified. Use this at every internal log site that
records a caught error.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
error | unknown | Caught value of unknown shape. |
Returns
Section titled “Returns”Record<string, unknown>
A redacted, JSON-safe object describing the error.