One exception hierarchy. Specific subclasses where you’d actually want to branch on the failure.
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.
401/403 — invalid key or not entitled to this endpoint
—
MinervaRateLimitError
429 — back off and retry
.retry_after (seconds)
MinervaAPIError
Other 4xx/5xx
.status_code, .api_request_id, .body
MinervaInsufficientCreditsError
402 — record export capacity failure; subclass of MinervaAPIError
Inherited API error fields, .code, .details
MinervaConfigError
Misconfiguration
—
Insufficient record capacity (402)
Record export returns HTTP 402 with codeinsufficient_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.
from minerva import MinervaInsufficientCreditsErrortry: result = mc.api.enrich(batch)except MinervaInsufficientCreditsError as error: details = error.details or {} print(f"Available records: {details.get('records_available')}; " f"requested: {details.get('records_requested')}")
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
import timefrom minerva import MinervaRateLimitErrorwhile True: try: result = mc.api.enrich(batch) break except MinervaRateLimitError as e: time.sleep(e.retry_after or 1)
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
from minerva import MinervaAPIErrortry: mc.api.enrich(records)except MinervaAPIError as e: print(f"server returned {e.status_code}") if e.api_request_id: print(f"quote to support: {e.api_request_id}")
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:
from minerva import MinervaValidationErrortry: mc.api.enrich([]) # 0 records — must be ≥ 1except MinervaValidationError as e: print("caught before any API call:", e)
Use dry_run=True to trigger the same validation without committing to the
call — see Validation & dry_run.
Catch-all
from minerva import MinervaErrortry: mc.api.enrich(records)except MinervaError as e: log.error("Minerva call failed", exc_info=e) raise
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.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Minerva Documentation","colors":{"primary":"#5B84E7","light":"#8EA8F0","dark":"#2E5BCF"},"logo":{"light":"https://mintcdn.com/minerva-a2a15a3a/4LFBmther9gqOLci/logo/Logo+Wordmark.svg?fit=max\u0026auto=format\u0026n=4LFBmther9gqOLci\u0026q=85\u0026s=80dfff22f85e3503c13e452578128b42","dark":"https://mintcdn.com/minerva-a2a15a3a/4LFBmther9gqOLci/logo/Logo+Wordmark_White.svg?fit=max\u0026auto=format\u0026n=4LFBmther9gqOLci\u0026q=85\u0026s=a312b4352c94561aaf43d34d331bb324"},"favicon":"https://mintcdn.com/minerva-a2a15a3a/taSOw2M7XeR05kge/favicon.svg?fit=max\u0026auto=format\u0026n=taSOw2M7XeR05kge\u0026q=85\u0026s=a062b886b18b17632a5788847a537418","api":{"playground":{"display":"simple"},"mdx":{"auth":{"method":"key","name":"x-api-key"},"server":"https://api.minerva.io"}},"fonts":{"heading":{"family":"ES Schwarzweiss","weight":700,"source":"fonts/ESSchwarzweiss-Variable.woff2","format":"woff2"},"body":{"family":"ES Schwarzweiss","weight":400,"source":"fonts/ESSchwarzweiss-Variable.woff2","format":"woff2"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"minerva-a2a15a3a","hasAudioNarration":false,"actualSubdomain":"minerva-a2a15a3a","customDomains":["docs.minerva.io"],"gitSource":{"type":"github","owner":"minervadata-hq","repo":"md-core","deployBranch":"prod","contentDirectory":"docs/api_sdk/mintlify","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"}},"buildId":"6aff631e1ec59d1b9a1b4237","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API Reference","count":38},{"language":"default","tag":"Platform","count":27},{"language":"default","tag":"SDK","count":24},{"language":"default","tag":"Person Search","count":11},{"language":"default","tag":"Segments","count":11},{"language":"default","tag":"Power features","count":11},{"language":"default","tag":"Data Dictionary","count":10},{"language":"default","tag":"Endpoints","count":7},{"language":"default","tag":"Core Endpoints","count":6},{"language":"default","tag":"Premium data","count":5}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":false},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"sdk/guides/error-handling","slug":"/sdk/guides/error-handling","pageMetadata":{"title":"Error handling","description":"One exception hierarchy. Specific subclasses where you'd actually want to branch on the failure.","href":"/sdk/guides/error-handling"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"One exception hierarchy. Specific subclasses where you’d actually want to branch on the failure.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`All SDK errors derive from `,_jsx(_components.code,{children:`MinervaError`}),`. The hierarchy lets you catch\nbroadly (any SDK error) or narrowly (specific failure mode), and most carry\ncontext attributes so you can build a useful UI without parsing message\nstrings.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-hierarchy`,children:`The hierarchy`}),`\n`,_jsx(CodeBlock,{numberOfLines:`9`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Exception`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└── MinervaError ← catch-all`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ├── MinervaConfigError ← misconfiguration`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ├── MinervaValidationError ← boundary failures, raised locally`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ├── MinervaAuthError ← 401/403 (bad key, not entitled)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ├── MinervaRateLimitError ← 429. .retry_after`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └── MinervaAPIError ← other 4xx/5xx. .status_code, .api_request_id, .body`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └── MinervaInsufficientCreditsError ← 402 record export capacity failure. .code, .details`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`quick-reference`,children:`Quick reference`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Exception`}),_jsx(_components.th,{children:`When`}),_jsx(_components.th,{children:`Carries`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaValidationError`})}),_jsx(_components.td,{children:`Bad input — raised locally, before the call`}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaAuthError`})}),_jsx(_components.td,{children:`401/403 — invalid key or not entitled to this endpoint`}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaRateLimitError`})}),_jsx(_components.td,{children:`429 — back off and retry`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.retry_after`}),` (seconds)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaAPIError`})}),_jsx(_components.td,{children:`Other 4xx/5xx`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.status_code`}),`, `,_jsx(_components.code,{children:`.api_request_id`}),`, `,_jsx(_components.code,{children:`.body`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaInsufficientCreditsError`})}),_jsxs(_components.td,{children:[`402 — record export capacity failure; subclass of `,_jsx(_components.code,{children:`MinervaAPIError`})]}),_jsxs(_components.td,{children:[`Inherited API error fields, `,_jsx(_components.code,{children:`.code`}),`, `,_jsx(_components.code,{children:`.details`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MinervaConfigError`})}),_jsx(_components.td,{children:`Misconfiguration`}),_jsx(_components.td,{children:`—`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`insufficient-record-capacity-402`,children:`Insufficient record capacity (402)`}),`\n`,_jsxs(_components.p,{children:[`Record export returns HTTP 402 with `,_jsx(_components.code,{children:`code`}),` `,_jsx(_components.code,{children:`insufficient_record_capacity`}),` when new records exceed the available plan allowance and monthly overage capacity. The SDK preserves its existing `,_jsx(_components.code,{children:`MinervaInsufficientCreditsError`}),` exception, a subclass of `,_jsx(_components.code,{children:`MinervaAPIError`}),`. Both sync and async clients expose the server’s code and capacity details.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` minerva `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaInsufficientCreditsError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mc.api.enrich(batch)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaInsufficientCreditsError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` details `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error.details `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Available records: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`details.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'records_available'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`; \"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"requested: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`details.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'records_requested'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`allowance_records_available`}),` and `,_jsx(_components.code,{children:`overage_records_available`}),` describe the two capacity sources. Increase the monthly spend limit or upgrade before retrying. A trial has no overage.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` minerva `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaRateLimitError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mc.api.enrich(batch)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaRateLimitError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(e.retry_after `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`or`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`retry_after`}),` is the server’s hint in seconds. Fall back to a sane default\n(1s) if the server didn’t supply one.`]}),`\n`,_jsx(Heading,{level:`2`,id:`server-errors`,children:`Server errors`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` minerva `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaAPIError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mc.api.enrich(records)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaAPIError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"server returned `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`e.status_code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e.api_request_id:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"quote to support: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`e.api_request_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`api_request_id`}),` is the server’s trace ID — quote it when reporting issues to\nsupport. Responses are forward-compatible: fields the server adds later won’t\nbreak an older SDK.`]}),`\n`,_jsx(Heading,{level:`2`,id:`validation-errors`,children:`Validation errors`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`MinervaValidationError`}),` is raised `,_jsx(_components.strong,{children:`locally`}),` before any HTTP call — bad\npayload shape, over-the-limit record counts, missing required fields:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` minerva `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaValidationError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mc.api.enrich([]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 0 records — must be ≥ 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaValidationError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"caught before any API call:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, e)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`dry_run=True`}),` to trigger the same validation without committing to the\ncall — see `,_jsx(_components.a,{href:`/sdk/guides/validation-dry-run`,children:`Validation \u0026 dry_run`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`catch-all`,children:`Catch-all`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` minerva `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mc.api.enrich(records)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MinervaError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` log.error(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Minerva call failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`exc_info`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`e)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`MinervaAuthError`}),` is also raised when no `,_jsx(_components.code,{children:`MINERVA_API_KEY`}),` is set (or\n`,_jsx(_components.code,{children:`api_key=`}),` passed) — that’s a local check, before any HTTP call. The error\nmessage tells you exactly what’s missing.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Error handling","description":"One exception hierarchy. Specific subclasses where you'd actually want to branch on the failure.","href":"/sdk/guides/error-handling"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The hierarchy","slug":"the-hierarchy","depth":2,"children":[]},{"title":"Quick reference","slug":"quick-reference","depth":2,"children":[]},{"title":"Insufficient record capacity (402)","slug":"insufficient-record-capacity-402","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Server errors","slug":"server-errors","depth":2,"children":[]},{"title":"Validation errors","slug":"validation-errors","depth":2,"children":[]},{"title":"Catch-all","slug":"catch-all","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"minerva-a2a15a3a","siteName":"Minerva Documentation","title":"Error handling - Minerva Documentation","contextualStarterQuestions":[{"_id":"6aa1658283a75e1fd8ee8ba5","deploymentId":"68ed07362d3e4d2fb94452da","questionText":"What's in the error hierarchy?","status":"active","generatedBy":"contextual","path":"sdk/guides/error-handling","createdAt":"2026-09-09T13:56:18.649Z","updatedAt":"2026-09-09T13:56:18.649Z","__v":0},{"_id":"6aa1658283a75e1fd8ee8ba6","deploymentId":"68ed07362d3e4d2fb94452da","questionText":"How do I handle rate limits?","status":"active","generatedBy":"contextual","path":"sdk/guides/error-handling","createdAt":"2026-09-09T13:56:18.649Z","updatedAt":"2026-09-09T13:56:18.649Z","__v":0},{"_id":"6aa1658283a75e1fd8ee8ba4","deploymentId":"68ed07362d3e4d2fb94452da","questionText":"How do I catch SDK errors?","status":"active","generatedBy":"contextual","path":"sdk/guides/error-handling","createdAt":"2026-09-09T13:56:18.649Z","updatedAt":"2026-09-09T13:56:18.649Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-09T13:56:05.726Z","originalFileLocation":"sdk/guides/error-handling.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"One exception hierarchy. Specific subclasses where you\u0026#x27;d actually want to branch on the failure.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Minerva Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Error handling - Minerva Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"One exception hierarchy. Specific subclasses where you\u0026#x27;d actually want to branch on the failure.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Minerva Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.minerva.io/sdk/guides/error-handling\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://minerva-a2a15a3a.mintlify.site/_mintlify/api/og/v2?division=Power+features\u0026amp;title=Error+handling\u0026amp;description=One+exception+hierarchy.+Specific+subclasses+where+you%27d+actually+want+to+branch+on+the+failure.\u0026amp;theme=e97f3b1d1117a7b9cb640af6\u0026amp;signature=51a5e80a1cf4521e1ef3813225758731b93d3fd47eabd75d2af2e12811dc711c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Error handling - Minerva Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"One exception hierarchy. Specific subclasses where you\u0026#x27;d actually want to branch on the failure.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://minerva-a2a15a3a.mintlify.site/_mintlify/api/og/v2?division=Power+features\u0026amp;title=Error+handling\u0026amp;description=One+exception+hierarchy.+Specific+subclasses+where+you%27d+actually+want+to+branch+on+the+failure.\u0026amp;theme=e97f3b1d1117a7b9cb640af6\u0026amp;signature=51a5e80a1cf4521e1ef3813225758731b93d3fd47eabd75d2af2e12811dc711c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/minerva-a2a15a3a/friUgrjnS8NK6ZsS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Minerva Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5B84E7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.minerva.io/sdk/guides/error-handling\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/guides/error-handling.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.minerva.io/#organization\",\"name\":\"Minerva Documentation\",\"url\":\"https://docs.minerva.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/minerva-a2a15a3a/4LFBmther9gqOLci/logo/Logo+Wordmark.svg?fit=max\u0026auto=format\u0026n=4LFBmther9gqOLci\u0026q=85\u0026s=80dfff22f85e3503c13e452578128b42\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.minerva.io#website\",\"name\":\"Minerva Documentation\",\"url\":\"https://docs.minerva.io\",\"publisher\":{\"@id\":\"https://docs.minerva.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.minerva.io/sdk/guides/error-handling#webpage\",\"url\":\"https://docs.minerva.io/sdk/guides/error-handling\",\"name\":\"Error handling\",\"description\":\"One exception hierarchy. Specific subclasses where you'd actually want to branch on the failure.\",\"dateModified\":\"2026-09-09T13:56:05.726Z\",\"isPartOf\":{\"@id\":\"https://docs.minerva.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.minerva.io/sdk/guides/error-handling#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.minerva.io/sdk/guides/error-handling#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Power features\",\"item\":\"https://docs.minerva.io/sdk/guides/async-and-batching\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Error handling\",\"item\":\"https://docs.minerva.io/sdk/guides/error-handling\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.minerva.io/sdk/guides/error-handling#article\",\"headline\":\"Error handling\",\"name\":\"Error handling\",\"description\":\"One exception hierarchy. Specific subclasses where you'd actually want to branch on the failure.\",\"url\":\"https://docs.minerva.io/sdk/guides/error-handling\",\"mainEntityOfPage\":{\"@id\":\"https://docs.minerva.io/sdk/guides/error-handling#webpage\"},\"dateModified\":\"2026-09-09T13:56:05.726Z\",\"publisher\":{\"@id\":\"https://docs.minerva.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.minerva.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Minerva Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Minerva Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/guides/error-handling.md","siteName":"Minerva Documentation","nav":{"global":null,"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":"/platform/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/minerva-data-mcp"}]},{"tab":"SDK","groups":[{"group":"Getting started","pages":[{"title":"Minerva Python SDK","href":"/sdk/introduction"},{"title":"Installation","href":"/sdk/installation"},{"title":"Quickstart","href":"/sdk/quickstart"},{"title":"Authentication","href":"/sdk/authentication"}]},{"group":"Endpoints","pages":[{"title":"Resolve","href":"/sdk/guides/resolve"},{"title":"Enrich","href":"/sdk/guides/enrich"},{"title":"Person Search","href":"/sdk/guides/person-search"},{"title":"LinkedIn contact info","href":"/sdk/guides/linkedin"},{"title":"Email validation","href":"/sdk/guides/validate-emails"},{"title":"Country inference","href":"/sdk/guides/infer-country"},{"title":"Usage tallies","href":"/sdk/guides/usage"}]},{"group":"Power features","pages":[{"title":"Async + bulk batching","href":"/sdk/guides/async-and-batching"},{"title":"Streaming batcher","href":"/sdk/guides/streaming-batcher"},{"title":"Workflows — `mc.workflows.*`","href":"/sdk/guides/workflows"},{"title":"Rate limiting (built in)","href":"/sdk/guides/rate-limiting"},{"title":"Custom \u0026 tailored endpoints","href":"/sdk/guides/custom-endpoints"},{"title":"Validation \u0026 dry_run","href":"/sdk/guides/validation-dry-run"},{"title":"Output formats","href":"/sdk/guides/output-formats"},{"title":"Spreadsheets — Google Sheets \u0026 Excel","href":"/sdk/guides/spreadsheets"},{"title":"Storage — bulk upload \u0026 download","description":"Move files in and out of your private storage area without writing boto3 by hand. Gated on the [storage] extra.","href":"/sdk/guides/storage"},{"title":"Error handling","href":"/sdk/guides/error-handling"},{"title":"Liveness","description":"Probe Minerva API endpoints via `mc.status.health()`. Auto-upgrades to an authenticated metrics view when the client has an API key. Never raises — safe to call in a polling loop.","href":"/sdk/guides/health"}]},{"group":"Reference","pages":[{"title":"CLI reference","href":"/sdk/reference/cli"},{"title":"Exception reference","href":"/sdk/reference/errors"}]}]},{"tab":"SFTP","pages":[{"title":"SFTP","href":"/sftp/introduction"}]}]},"basePath":"","title":"Error handling - Minerva Documentation","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}