PowfiSDKError, which extends Error. Import them from the package root and narrow with instanceof:
Typed errors
TokenListFetchError exposes status?: number and the original error as cause.
Some module methods catch errors and re-throw them as a plain
Error with a combined message (via logAndThrowError), for example Failed to fetch pool state on <id>, <original message>. TokenModule.getTokens() and fetchTokens() behave this way, so the TokenListFetchError text appears in the message but the thrown object is an Error. Match on the message if you need to tell them apart.Validation errors (plain Error)
On-chain errors
If a transaction passes SDK validation but fails in the contract (slippage exceeded, deadline passed, price limit violated), the node rejects it during signing and@alephium/web3 throws with the VM error code in the message, for example Error Code: 501 when a CLMM swap hits its price limit before filling the full amount (106 if the limit is on the wrong side of the price). The most common causes:
- Slippage or deadline: the pool moved between quote and submission. Re-quote and retry.
- Insufficient ALPH for dust or deposits: see ALPH deposits and dust.
- Wrong direction or price limit on CLMM
swapTo: the target price is already past the current price.