DeadLetterBehaviorOptions
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:41
Per-handler (and module-default) options for DeadLetterBehavior.
Supplied per handler via
@UsePipeline([DeadLetterBehavior, { ... }]), shallow-merged over the
module-wide defaults (handler keys win), except that ignoreErrors and
redactKeys set at both levels are combined.
Example
Section titled “Example”Fire-and-forget event capture
@UsePipeline([DeadLetterBehavior, { captureKinds: ['event'], rethrow: false, redactKeys: ['token'],}])export class UserCreatedHandler {}Properties
Section titled “Properties”captureKinds?
Section titled “captureKinds?”
optionalcaptureKinds?:DeadLetterRequestKind[]
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:65
Request kinds to capture. Default ['event']: a command’s or query’s
caller already receives the error. Example: ['command', 'event'] to also
keep failed commands.
ignoreErrors?
Section titled “ignoreErrors?”
optionalignoreErrors?: (Type<unknown> | ((…args) =>unknown))[] | ((error,context) =>boolean)
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:72
Filter predicate or error types to ignore. Matching errors are re-thrown without being sent to the dead-letter transport. Useful for ignoring expected client validation errors (e.g. ZodValidationError).
includeStack?
Section titled “includeStack?”
optionalincludeStack?:boolean
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:58
Include the error stack trace in the record. Default true.
Set false to keep records lean or avoid leaking internals downstream.
metadata?
Section titled “metadata?”
optionalmetadata?:DeadLetterMetadataFactory
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:77
Produce extra metadata to merge into the dead-letter record.
redact?
Section titled “redact?”
optionalredact?: (payload) =>unknown
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:83
Custom redactor function for the captured request payload. When supplied, takes precedence over redactKeys.
Parameters
Section titled “Parameters”payload
Section titled “payload”unknown
Returns
Section titled “Returns”unknown
redactKeys?
Section titled “redactKeys?”
optionalredactKeys?:string[]
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:89
Field names to mask with [REDACTED] in the captured request payload.
Case-insensitive matching. Merged on top of DEFAULT_REDACT_KEYS.
rethrow?
Section titled “rethrow?”
optionalrethrow?:boolean
Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:52
Whether to re-throw the original error after dead-lettering.
true(default) — propagate after the capture decision; the caller sees the failure (HTTP 5xx, command rejection, …). Use for commands/queries.false— on an event handler only, swallow the error when it is captured and the transport delivers it; the pipeline then resolves toundefinedand the swallow is logged aterrorlevel with the record id. On a command or query handler it is a bootstrap diagnostic and is ignored.