Skip to content

ModelError

Defined in: src/errors.ts:18

Base exception class for all model-related errors.

This class serves as the common base type for errors that originate from model provider interactions. By catching ModelError, consumers can handle all model-related errors uniformly while still having access to specific error types through instanceof checks.

  • Error
new ModelError(message, options?): ModelError;

Defined in: src/errors.ts:25

Creates a new ModelError.

ParameterTypeDescription
messagestringError message describing the model error
options?{ cause?: unknown; }Optional error options including the cause
options.cause?unknown-

ModelError

Error.constructor