Errors
An error answers with its status and a JSON body. _tag names the error, message explains it, and some errors add fields:
SpendEventConflict
{
"_tag": "SpendEventConflict",
"id": "se:acme:alice:clearing:txn_0001",
"message": "This event ID was already used by an event with different content"
}| Status | _tag | Extra fields | Retry? |
|---|---|---|---|
400 | InvalidRequest | part: Payload, Query, Params or Headers | No: fix the request |
401 | Unauthorized | No: check your key | |
403 | IntegratorMismatch | No | |
403 | IntegratorSuspended | No: contact Gave | |
409 | SpendEventConflict | id | No: the ID was used with different content |
409 | SimulationConflict | reference | No: use a new reference |
422 | EventInFuture | No: check the sender's clock | |
422 | SimulationRefused | reference | No |
429 | RateLimited | retryAfterSeconds | Yes, after that delay |
503 | Unavailable | Yes, with backoff |
Retrying
Retry 429, 503, timeouts and network errors with the same request. Every write is idempotent, so a request that did go through the first time is answered as a duplicate, and changes nothing. Wait longer between each attempt, with some randomness, and give up after a bound you choose.
Never retry any other 4xx unchanged: it will be refused again.