Errors and retries

Errors

  • Stable unknown
  • Release candidate since 0.1.0-rc.1
  • Development since 0.1.0-dev+fa3c303

Errors

SDK errors extend OvokException, an unchecked exception. A response that is not a success throws an OvokApiException subtype:

StatusException
400, 422OvokValidationException
401OvokAuthenticationException
403OvokPermissionException
404OvokNotFoundException
409OvokConflictException
429OvokRateLimitException
5xxOvokServiceException

Other statuses throw OvokApiException. Read status(), code(), type(), traceId(), requestId(), retryAfter(), and body() from the exception.

A network failure throws OvokConnectionException, and an invalid configuration throws OvokConfigException. SDK methods also declare IOException and InterruptedException.

Request options

Most methods have an overload that takes RequestOptions. Set a timeout for one request with new RequestOptions(Duration.ofSeconds(5)); RequestOptions.defaults() uses the configured timeout.

Retries

Idempotent requests retry transient failures up to maxNetworkRetries times and honor Retry-After. An authenticated request that answers 401 refreshes its token once and retries.

Last updated on

On this page