Mirascopev2
Lilypad

exceptions

Class MirascopeError

Base exception for all Mirascope errors.

Bases:

Exception

Attributes

NameTypeDescription
original_exceptionException | None-

Class APIError

Base class for API-related errors.

Bases:

MirascopeError

Attributes

NameTypeDescription
status_codeint | None-

Class ConnectionError

Raised when unable to connect to the API (network issues, timeouts).

Bases:

MirascopeError

Class AuthenticationError

Raised for authentication failures (401, invalid API keys).

Bases:

APIError

Class PermissionError

Raised for permission/authorization failures (403).

Bases:

APIError

Class BadRequestError

Raised for malformed requests (400, 422).

Bases:

APIError

Class NotFoundError

Raised when requested resource is not found (404).

Bases:

APIError

Class ToolNotFoundError

Raised if a tool_call cannot be converted to any corresponding tool.

Bases:

MirascopeError

Class FeatureNotSupportedError

Raised if a Mirascope feature is unsupported by chosen provider.

If compatibility is model-specific, then model_id should be specified. If the feature is not supported by the provider at all, then it may be None.

Bases:

MirascopeError

Attributes

NameTypeDescription
providerProvider-
model_idModelId | None-
featurestr-

Class FormattingModeNotSupportedError

Raised when trying to use a formatting mode that is not supported by the chosen model.

Bases:

FeatureNotSupportedError

Attributes

NameTypeDescription
formatting_modeFormattingMode-

Class RateLimitError

Raised when rate limits are exceeded (429).

Bases:

APIError

Class ServerError

Raised for server-side errors (500+).

Bases:

APIError

Class TimeoutError

Raised when requests timeout or deadline exceeded.

Bases:

MirascopeError