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:
| Status | Exception |
|---|---|
| 400, 422 | OvokValidationException |
| 401 | OvokAuthenticationException |
| 403 | OvokPermissionException |
| 404 | OvokNotFoundException |
| 409 | OvokConflictException |
| 429 | OvokRateLimitException |
| 5xx | OvokServiceException |
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