Crux
API Reference@use-crux/coreSignals

Signal errors

Exact public Signal error classes, stable codes, and Runtime errors around durable delivery.

Import Signal domain errors from @use-crux/core/signal.

SignalErrorCode

type SignalErrorCode =
  | "invalid_payload"
  | "idempotency_conflict"
  | "publication_rejected";
CodeMeaning
invalid_payloadAuthored input failed the Signal schema.
idempotency_conflictOne Signal reused a key with different canonical normalized data.
publication_rejectedSchema execution or required durable acceptance could not finish safely.

SignalError

class SignalError extends Error {
  readonly code: SignalErrorCode;
  constructor(code: SignalErrorCode, message: string);
}

Base domain error for validation and publication. Publicly thrown instances omit raw idempotency keys, payload fields, credentials, and consumer internals. Callers normally catch instances produced by publish() rather than construct their own.

SignalValidationError

class SignalValidationError extends SignalError {
  readonly issues: readonly StandardSchemaV1.Issue[];
  constructor(issues: readonly StandardSchemaV1.Issue[]);
}

code is always invalid_payload. issues is detached, deeply frozen, bounded to 20 entries and 20 path segments per entry, and uses a sanitized message without rejected payload values. Unsupported path values are omitted.

Durable infrastructure and target failures reuse the Runtime error contract:

CodeWhen
CAPABILITY_MISSINGA static Signal Flow activates without the complete durable capability profile.
TARGET_NOT_FOUNDDurable resume cannot resolve its Flow target or snapshot.
TARGET_NOT_EXPORTEDThe deployed target cannot be imported as required.
PAYLOAD_NOT_JSONNormalized output, match data, or a persisted occurrence is not valid Signal JSON.
EVAL_REACTIVE_DISPATCH_FORBIDDENEval publication would dispatch to an armed durable Flow.

These errors expose structured code, whatFailed, why, whatStillWorks, nextStep, and docsUrl fields. Validation and capability errors happen before acceptance. Publication acceptance never waits for a later consumer error, retry, or completion.

See Operations and errors for handling patterns.

On this page