Skip to main content
All SDK errors derive from MinervaError. The hierarchy lets you catch broadly (any SDK error) or narrowly (specific failure mode), and most carry context attributes so you can build a useful UI without parsing message strings.

The hierarchy

Quick reference

Insufficient record capacity (402)

Record export returns HTTP 402 with code insufficient_record_capacity when new records exceed the available plan allowance and monthly overage capacity. The SDK preserves its existing MinervaInsufficientCreditsError exception, a subclass of MinervaAPIError. Both sync and async clients expose the server’s code and capacity details.
allowance_records_available and overage_records_available describe the two capacity sources. Increase the monthly spend limit or upgrade before retrying. A trial has no overage.

Rate limits

retry_after is the server’s hint in seconds. Fall back to a sane default (1s) if the server didn’t supply one.

Server errors

api_request_id is the server’s trace ID — quote it when reporting issues to support. Responses are forward-compatible: fields the server adds later won’t break an older SDK.

Validation errors

MinervaValidationError is raised locally before any HTTP call — bad payload shape, over-the-limit record counts, missing required fields:
Use dry_run=True to trigger the same validation without committing to the call — see Validation & dry_run.

Catch-all

MinervaAuthError is also raised when no MINERVA_API_KEY is set (or api_key= passed) — that’s a local check, before any HTTP call. The error message tells you exactly what’s missing.