Defjs
Core

FaultCode

Every failure Defjs reports, as one closed set of codes.

@defjs/core · Type

Signature

type FaultCode =
  | "CAP_BUFFER_EXCEEDED"
  | "CAP_QUEUE_OVERFLOW"
  | "ENV_UNSUPPORTED"
  | "EXT_HOOK_FAILED"
  | "EXT_INTERCEPTOR_FAILED"
  | "EXT_OBSERVER_FAILED"
  | "HTTP_STATUS"
  | "NET_ABORTED"
  | "NET_BODY_INCOMPLETE"
  | "NET_TIMEOUT"
  | "NET_UNREACHABLE"
  | "REQ_BUILD_FAILED"
  | "REQ_INPUT_INVALID"
  | "REQ_OPTIONS_INVALID"
  | "RES_DECODE_FAILED"
  | "RES_MEDIA_TYPE_INVALID"
  | "RES_STRUCT_MISMATCH";

The prefix before the first _ is the class; there is no separate kind field. Read the prefix for coarse triage and the whole code for an exact case:

ClassMeaning
HTTPThe peer answered with a non-2xx status.
REQThe request never left: input, request options, or build.
NETNo usable response: cancel, timeout, connect, truncated body.
RESA response arrived but could not be read as declared.
EXTCode you attached to the pipeline threw.
CAPA declared buffer or queue limit was exceeded.
ENVThe host runtime lacks a required capability.

The set is closed on purpose: it keeps switch (fault.code) exhaustive. Extensions report their own detail through cause, not through a new code.

Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao