TrussetError and its subclasses ValidationError, AuthError, NetworkError and ConfirmationError. Each carries code, statusCode, requestId, details, data and retryAfter. See Error handling for the class hierarchy and the codes that apply to every module.
Know what was sent before you act
The first question for any failed write is whether a transaction went out. The answer decides the next step.Errors the SDK raises itself
These come from checks the SDK runs before or while it signs. A status of0 means the error never came from the API.
ConfirmationError also carries transactions, one entry per step with functionName, txHash, optional and error, plus txHash, the hash to confirm, and failure, the underlying error.
API codes every area shares
Area pages list the codes of their own routes. These come back from every area.
A
503 from a lending route means a chain read or a record could not be read just then. It is never a verdict about the market, the loan or the wallet. Treat it as unknown and retry, not as a refusal.
Retry behavior
The SDK retries by request kind. A build or an off-chain write is never repeated after an ambiguous failure, because the first attempt may already have taken effect.
On a
429 the SDK waits as long as Retry-After says, at most 60 seconds. Other retries back off 1, 2 and 4 seconds, capped at 10. maxRetries on the client caps the attempts, and 0 turns retries off.
The confirms sent once belong to bots.deploy, liquidations.withdrawCollateralForSale, liquidations.reportPartialSale and liquidations.handleTimeout. The API does not record them idempotently. When one fails ambiguously, read the bot or the liquidation before you confirm again.
Catch a lending write
Order the branches from most specific to least.ConfirmationError extends TrussetError, so test it first.
code and message, such as candidates on an unknown market or the role a refusal names. They land in err.data.