Skip to main content

Error Handling

This guide covers common errors you’ll encounter when integrating with Kroko DEX and how to handle them.

API Errors

When an API call fails, the response includes an error message:

Transaction Errors

On-Chain Reverts

These errors occur when the transaction is submitted but reverts on-chain:

Wallet Errors

Approval Errors

Common issues with the approval flow:

Checking Approval State

Best Practices

Pre-flight Checks

Before executing a swap, verify:

Retry Strategy

  • API errors: Safe to retry immediately (transient network issues)
  • On-chain reverts: Do NOT retry blindly — diagnose the cause first
  • User rejection: Do not retry — wait for user to initiate again
  • Slippage errors: Re-fetch the quote (price may have changed) and retry with fresh calldata