Skip to content
Français

unavailableFault

import { unavailableFault } from "@elie-laloum/outpost";

Return { message } from details.unavailable of the first non-quota OutpostError that sets it, searching the error and up to seven wrapped causes, or undefined. Outages keep their process, provider or timeout code, so test with this function rather than the code. Fallback agents covering unavailable use the same test.

Complete example and detailed rules.

  • errorRequired
    unknown
    Any caught value; wrapped causes are followed.

UnavailableFault | undefined

export declare function unavailableFault(
  error: unknown,
): UnavailableFault | undefined;