Skip to main content

Type Alias: Fault

A status whose code a store/adapter can answer with, rather than one only flow or validation logic raises.

Fault = number & { __fault: true; }

Defined in: brand.ts:32

A status whose code a store/adapter can answer with, rather than one only flow or validation logic raises.

Type Declaration

__fault

readonly __fault: true

Example

const REGISTRY = {
  RATE_LIMITED: detail<{ retryAfter: number }>(429), // flow-raised only
  STORAGE_FAILED: fault<{ cause?: string }>(500), // an adapter can raise this one itself
} as const satisfies Record<string, number>

type StoreRaisable = ErrorKit.Faults<typeof REGISTRY> // 'STORAGE_FAILED'