Errors and retries
Every failure is an OvokException with status, code, type, message,
- Stable unknown
- Release candidate since 0.1.0-rc.3
- Development since 0.1.0-dev.17+c121e27
Every failure is an OvokException with status, code, type, message,
traceId, requestId, retryAfterMs and fieldErrors. Catch a subclass to handle
one case:
| Class | When |
|---|---|
OvokValidationException | 400, 422 |
OvokAuthenticationException | 401 |
OvokPermissionException | 403: signed in, but not allowed |
OvokNotFoundException | 404 |
OvokConflictException | 409 |
OvokRateLimitException | 429 |
OvokServiceException | 5xx |
OvokConnectionException | No answer: network failure or timeout |
OvokConfigException | A bad option, or an action this client cannot take |
try {
await ovok.fhir.read('Patient', id);
} on OvokNotFoundException {
// show "not found"
} on OvokException catch (error) {
log('Ovok failed', error: error.traceId);
}Quote traceId when you report a problem.
Retries and timeouts
- Retried requests: GET, PUT, DELETE and conditional creates retry on 429, 502,
503, 504 or a connection failure, up to
maxNetworkRetriestimes. - Backoff: the first wait is 300 ms and doubles each time;
Retry-Afterwins, and no wait is longer than 5 s. - Timeouts: a timed-out request fails with
OvokConnectionException.package:httpcannot cancel it, so it may still reach the server.
Last updated on