Skip to main content

Error handling

The SDK translates each HTTP error code into a nested subclass of MarkpdfException (RuntimeException).

Exceptions table

Todas extienden MarkpdfException y exponen:
##Catch specific exceptions

With runCatching

Automatic retries

OkHttp retries internally:
  • 429 and 5xx: retries with exponential backoff and jitter. Honor Retry-After if the server sends it.
  • 4xx different from 429: not retried.
  • Network/timeout errors: retried same as 5xx.
To disable or adjust retries, inject your own OkHttpClient with a custom Interceptor when building MarkpdfClient(http = ...).

Job falvavalid

JobFailedException means that the job has already exhausted internal server retries. Retrying from the client is reasonable, but do it with backoff.