Error handling
The SDK translates each HTTP error code of the API into a typed exception, all inheriting fromMarkpdfError.
Exceptions table
They all inherit from
markpdf.MarkpdfError, which states:
int | None
Original HTTP code, or
None for network errors.str
Message
detail returned by API.str | None
If the response brings a request id header, it is exposed here to report the problem.
Automatic retries
The client automatically retries429 and 5xx with exponential backoff up to max_retries (default 2):
429and5xx: retried. Respect theRetry-Afterheader if present; if not, use exponential backoff with jitter.4xxother than429: not retried — the error almost always means that the request must be corrected, not repeated.- Network errors (
MarkpdfConnectionError): retried the same as5xx.
