# Handle the unhappy path.

Clear failures, deliberate retries, and safe wallet behavior.



## API and SDK errors

```ts
import { Floor1Error } from '@floor1/sdk';

try {
  const quote = await floor1.quote({ token, side: 'buy', amount });
} catch (error) {
  if (error instanceof Floor1Error) {
    console.error(error.code, error.status, error.retryAfterSeconds);
  } else {
    throw error;
  }
}
```

Code | Recovery | 

invalid_amount / invalid_token / invalid_slippage | Correct the input before sending another request. | 

invalid_metadata / invalid_creator_fee | Fix the mint fields or Arweave URI. | 

wallet_required / account_required | Connect a wallet account. | 

wrong_chain | Switch the connected wallet to Giwa Sepolia. | 

network | Check connectivity and offer a manual retry. | 

invalid_response | Do not sign. Treat the response as unusable. | 

quote_expired | Request a fresh quote. | 

rate_limited / unavailable | Respect retryAfterSeconds when present. | 

## Wallet errors

A rejected wallet prompt is not an SDK error. Wallet provider errors, transaction simulation errors, and send failures pass through unchanged. Keep their details available for your wallet UI. The SDK does not retry quote requests or wallet sends automatically.

## Contract reverts

```ts
import { decodeFloor1Revert } from '@floor1/sdk';

const reason = decodeFloor1Revert(revertData);
```

Revert | Meaning | 

Slippage | Output moved below the minimum. Request a fresh quote. | 

NotActive | The token’s curve is not active. | 

InsufficientLiquidity | The curve cannot cover the requested output. | 

Paused | The market or factory is paused. | 

NotWeth / QuoteNotAllowed | Quote asset is unsupported by this call. | 

FeeTooHigh | The requested creator fee share is not accepted. | 

NotWired | Factory configuration is incomplete. | 

Unknown revert data returns null. A contract can reject a valid local transaction if state changes before execution. After a broadcast error, check your wallet’s transaction history before submitting again to avoid duplicate trades.


