Skip to content
Français

ResponseError

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

OutpostError with code response, thrown when a typed answer has no complete tag or its content fails parsing or validation. A dispatch throws it once no repair turn remains; its recovery then names the conversation, branch, directory and turns.

Complete example and detailed rules.

  • tagRequired
    string
    Tag the response contract expected.
  • rawRequired
    string | undefined
    Trimmed content of the last complete tag that failed parsing or validation; undefined when no complete tag was found.
  • recoveryRequired
    Readonly<Record<string, unknown>>
    Locations of work retained after the failure, such as branch, directory, commits, transcript, logReference or conversation; empty when nothing was retained. A remote synchronization failure puts its transfer directory in details.recovery instead.
  • codeRequired
    FaultCode
    Stable Outpost fault category used for programmatic failure handling.
  • detailsRequired
    Readonly<Record<string, unknown>>
    Frozen diagnostics for the code: status, stdout, stderr and conversation for a failed agent process; status and retryAfterMs (the minimum wait of a task retry) for an HTTP model error; resetAt for a quota, and fallback when every fallback candidate hit one. unavailable marks an outage for unavailableFault(), including a timeout after an agent reported a connection failure.
  • nameRequired
    string
    Error class name used to distinguish this failure from other JavaScript errors.
  • messageRequired
    string
    Human-readable explanation of the failure.
  • stackOptional
    string | undefined
    JavaScript stack trace for the error, when available.
  • causeOptional
    unknown
    Underlying failure this error wraps; quotaFault() and unavailableFault() follow this chain.
export declare class ResponseError extends OutpostError {
  readonly tag: string;
  readonly raw: string | undefined;
  constructor(tag: string, message: string, raw?: string, cause?: unknown);
}