Skip to main content

Function: fault()

The same declaration as detail, for a code an adapter can answer with itself.

Call Signature

fault(status: number): Fault

Defined in: brand.ts:74

The same declaration as detail, for a code an adapter can answer with itself.

Parameters

status

number

Returns

Fault

Example

const REGISTRY = {
  INTERNAL: fault(500), // adapter-raisable, no meta
  STORAGE_FAILED: fault<{ cause?: string }>(500), // adapter-raisable, with meta
} as const satisfies Record<string, number>

Call Signature

fault<M extends object>(status: number): number & { __carries: M; } & { __fault: true; }

Defined in: brand.ts:75

The same declaration as detail, for a code an adapter can answer with itself.

Type Parameters

M

M extends object

The meta shape the code carries, when given.

Parameters

status

number

Returns

number & { __carries: M; } & { __fault: true; }

Example

const REGISTRY = {
  INTERNAL: fault(500), // adapter-raisable, no meta
  STORAGE_FAILED: fault<{ cause?: string }>(500), // adapter-raisable, with meta
} as const satisfies Record<string, number>