API · Core

Error API

Keep the original error while attaching the input and stage that introduced it.

Record errors

An operational Error is annotated in place when possible and satisfies:

interface ExstreamError<Input = unknown> extends Error {
  readonly exstreamError: true
  readonly exstreamInput: Input
  readonly reason?: unknown
  readonly exstreamFatal?: boolean
  readonly exstreamInfo?: { origin: ErrorOrigin; stage?: string; input?: Input }
}

Non-Error reasons are wrapped. exstreamInput identifies the record being processed. exstreamFatal marks graph failures. Provenance origin is one of source, operator, format, sink, lifecycle, or unknown.

errorInfo()

errorInfo<Input = unknown>(error: unknown): ErrorInfo<Input>

Returns frozen provenance without replacing the original error. Known format errors infer their stage; unknown values return { origin: 'unknown' }.

Exported classes

ClassDistinct fields
BufferOverflowErrorcode: 'EXSTREAM_BUFFER_OVERFLOW', limit
MapAsyncTimeoutErrorcode: 'EXSTREAM_MAP_ASYNC_TIMEOUT', timeout, attempt
CsvParseErrorcode, line, column, offset, record
CsvStringifyErrorcode, record, optional column
JsonParseErrorcode, line, column, offset, optional record
JsonStringifyErrorcode, optional record

Codes distinguish structural, encoding, depth, size, and output failures; the corresponding format pages list when each limit is applied.

errors(), failOnError(), csv(), json(), mapAsync()