Error codes
We wrap all known errors, adding some extra fields to make it easy to control exceptions.
It's also possible to use the message
field of ErrorWrapper
object to inform users about the details of the exception.
Additional fields to Error
object:
code: number
- error codecodeDesc: string
- error code definition
This table lists the error code information returned by PolidoSDK when an error is thrown.
Error code | Error code definition | Message |
---|---|---|
100 | CANNOT_CONFIRM_TRANSACTION | Got an error from the blockchain during transaction confirmation, so this error could have different messages directly from the blockchain |
300 | UNSUPPORTED_CLUSTER | PolidoSDK only supports Mainnet or Sepolia, please specify CHAINS.Mainnet or CHAINS.Sepolia |
400 | PROVIDER_REQUIRED | A Provider is required to be passed to the constructor |
401 | EXCEED_MAX | Amount must not exceed (..) |
402 | NO_ACCOUNT_INFO | Account info was not found |
500 | SERVER_ERROR | Generic Server Error |
501 | POLYGON_API_ERROR | Error from a call to Lido on Polygon API |
502 | COINGECKO_API_ERROR | Error from a call to Coingecko API |