Skip to content

Errors

Every failure returned by the SDK is a *polipage.Error with a Code. SDK-internal codes are lowercase; codes from the API are uppercase.

CodeWhen
invalid_optionsConstructor options are missing or malformed (`apiKey is required`).
network_errorTCP/TLS-level failure reaching the API (`Network request failed`; the net/http error is the Cause). Retryable.
timeoutThe request did not complete within the configured WithTimeout (`Request timed out after <ms>ms`). Retryable.
abortedCaller context was cancelled, also during the PDF download (`Request was aborted`). Not retryable.
io_failedLocal filesystem write failed in RenderToFile.
DOWNLOAD_FAILEDFetching a presigned PDF URL failed: `Failed to download PDF: HTTP <status>` with the storage status, or `Failed to download PDF: network error` without one, also when the connection drops while the body is read. Never retryable, whatever the storage status.
CodeWhen
MISSING_API_KEYNo API key in the request.
INVALID_API_KEYThe API key is malformed or revoked.
CodeWhen
FORBIDDENThe key does not have access to the requested resource.
ENVIRONMENT_PROTECTEDThe environment is protected: this key may not delete its documents (a service key may).
ORGANIZATION_PAYMENT_GRACEOrganization billing is past due; the organization is read-only.
ORGANIZATION_CANCELLEDThe organization has been cancelled.
ORGANIZATION_PURGEDThe organization has been purged.
THUMBNAILS_NOT_AVAILABLEThe organization's plan does not include thumbnails.
CodeWhen
NOT_FOUNDThe requested resource does not exist.
PROJECT_NOT_FOUNDNo project matches the supplied slug.
PROJECT_NOT_IN_ENVIRONMENTThe project is not published in the key's environment.
TEMPLATE_NOT_FOUNDNo template matches the supplied slug in the published project.
DOCUMENT_NOT_FOUNDNo stored document matches the supplied id.
DOCUMENT_GONEThe document was deleted or has expired.
CodeWhen
VALIDATION_ERRORThe request body failed validation (unknown field, bad value).
MISSING_DATARequest body lacks the required Data field.
MISSING_TEMPLATE_SLUGTemplate slug is missing.
PROJECT_REQUIRED_FOR_DOCUMENTRenderInput.Project is empty (`project is required`), checked before any request.
ENVIRONMENT_MISMATCHThe resource belongs to another environment than the key's.
TEMPLATE_ERRORThe template failed to render with the supplied data.
TEMPLATE_UNSAFEThe template, a partial or an SVG asset holds an injection attempt; `detail` names it.
EMPTY_DOCUMENTThe render produced no pages.
RENDER_BODY_TOO_LARGEThe request body exceeds the render size limit.
DOCUMENT_TOO_LARGEThe document exceeds the engine's size or complexity limit.
CodeWhen
QUOTA_EXCEEDEDMonthly quota reached (429). Not retryable: it lasts until the monthly reset.
OVERAGE_CAP_EXCEEDEDOverage cap reached (429). Not retryable: it lasts until the monthly reset.
RATE_LIMIT_EXCEEDEDToo many requests. Retryable.
CodeWhen
INTERNAL_ERRORThe API returned 5xx, or an error answer whose body is not JSON (message `HTTP <status>`, real status kept). Retryable.
PUBLISH_IN_PROGRESSA publish locks the project in the key's environment. Retryable after Retry-After.
ORGANIZATION_MIGRATINGThe organization is being migrated. Retryable.
STORAGE_ACCESS_DENIEDThe organization's own storage bucket refuses access (502). Not retryable: restore the bucket role, then call again.
RENDER_TIMEOUTThe render did not finish in time. Retryable.