Errors
| Class | Thrown when | Fields |
|---|---|---|
ArrektaError | the node or gateway returns an error (RFC 9457 application/problem+json) | status, code, title, detail |
DecodeError | bytes don't decode (bad transaction, PST, address, …) | message |
ValidationError | a local check fails before anything is sent | code |
Branch on code, never on the message: codes are stable and each has a page in the
error code reference.
import { ArrektaError, sendTransaction } from 'arrekta-sdk'
try {
await sendTransaction(client, { tx })
} catch (e) {
if (e instanceof ArrektaError && e.code === 'insufficient-fee') {
// a conflicting transaction pays more: bump the fee
} else throw e
}| HTTP status | Meaning |
|---|---|
| 400 | bad encoding or address |
| 404 | not found |
| 409 | rejected by mempool policy |
| 422 | consensus rule violated |
| 429 | rate limited |
See the error model.