Node SDK · Errors

The SDK exports these recorder error classes:

  • HttpError. Non-2xx from the ingestion endpoint. Check statusCode, body, transient (true for 5xx and 429, which are retried), and retryAfter: the server's Retry-After in ms, 0 when absent or not a whole number of seconds.
  • NetworkError. The request failed before any response (DNS, connection refused, reset). transient is true, so it is retried, and cause holds the underlying error.
  • EncodeError. An event could not be serialized to JSON, for example a BigInt or a circular reference in metadata. Never retried: a buffered batch that hits it is split and the bad event is dropped as rejected.
  • BufferFullError. Overflow when overflowPolicy: "error".
  • DrainTimeoutError. close() exceeded drainTimeout with pending events.

A request that exceeds requestTimeout or flushTimeout rejects with an error named TimeoutError, which is retried.

If you write your own inner recorder, set transient: true on errors worth retrying. BufferedRecorder retries those and errors named TimeoutError, and treats anything else, such as a plain TypeError, as permanent. See What happens when delivery fails.

Minter calls reject with a plain Error on client-side validation failures (invalid tenantId, malformed wildcard), MinterError on HTTP 400/401/404, or a transport error on network failure.