SeyfertError

Base error type used by Seyfert. It supports optional machine-readable metadata and preserves the original cause when wrapping lower-level errors.

Signature

export declare class SeyfertError extends Error
JSDoc
Examples
throw new SeyfertError('INVALID_TOKEN', {
  metadata: { shardId: 0 },
});
@remarksFor validation errors, prefer structured metadata (you can use {@link createValidationMetadata }) with: - `expected`: expected value or shape - `received`: received value - `receivedType`: optional primitive/runtime type

Properties

name: string;

Error name used in logs and stack traces.

metadata?: Record<string, unknown>;

Optional contextual data attached to the error.

Methods

toJSON(): {    name: string;    message: string;    code: SeyfertErrorCode;    metadata: Record<string, unknown> | undefined;    cause: unknown;};

Serializes the error into a plain object.

Returns

Serializable error payload including name, message, code, metadata and cause.