Error Code: AmountOutTooLow. client.parseSwapError(error) reads the same name from a failed send or simulation. Match on the name, not the number.
Swaps
Prices
Pairs and liquidity
Administration
Tokens
A transfer can also fail inside the token program, outside these errors:
insufficient funds when the user or the vault lacks the tokens, or an issuer’s rejection when a wallet or vault is frozen or not admitted.
Framework errors
Anchor checks accounts before the program runs. The common failures:Error numbers
Program errors are numbered from 6000 in the order the IDL lists them. Price-source errors come from code shared with the Treasury program and keep their own numbers, which overlap: a missing Redstone account is logged asMissingRedstoneAccount with number 6034, the number the IDL gives FeedIdMismatch. The name in the log is always right. parseSwapError checks both the name and the number.