Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Error Handling

All Zora CLI errors follow a consistent format. In --json mode, errors return a structured object.

Error Format

Terminal Mode

Error: Insufficient ETH balance
Current balance: 0.001 ETH. Need at least 0.01 ETH.

JSON Mode

{
  "error": "Insufficient ETH balance",
  "suggestion": "Current balance: 0.001 ETH. Need at least 0.01 ETH."
}

The CLI exits with code 1 on errors.

Common Errors

Authentication

ErrorCauseFix
Rate limitedToo many requests without API keySet ZORA_API_KEY
Invalid API keyKey is malformed or expiredGenerate a new key at zora.co/settings/developer

Wallet

ErrorCauseFix
No wallet configuredTrading command without walletRun npx @zoralabs/cli setup --create or set ZORA_PRIVATE_KEY
Permission deniedCannot read wallet fileCheck file permissions on ~/.config/zora/wallet.json

Trading

ErrorCauseFix
Insufficient ETH balanceNot enough ETH for the tradeReduce amount or add funds
Insufficient token balanceNot enough of the specified tokenCheck balance with npx @zoralabs/cli balance --json
Slippage exceededPrice moved beyond toleranceIncrease --slippage or retry
Transaction revertedOn-chain execution failedSee decoded error message for specific guidance

Decoded Contract Errors

The CLI decodes Solidity revert errors into human-readable messages with actionable guidance. Instead of an opaque "Execution reverted" message, specific contract errors are shown with suggestions:

Error: ERC20InsufficientBalance
You don't have enough of this coin to complete the sell. Check your balance with `zora balance`.

17 known contract errors are decoded, covering common scenarios like insufficient balances, slippage violations, and invalid trade parameters.

Coin Resolution

ErrorCauseFix
Coin not foundAddress or name doesn't match a coinVerify the address or use a type prefix to disambiguate
Ambiguous identifierName matches multiple coin typesUse a type prefix: creator-coin <name> or trend <name>

Invalid Options

ErrorCauseFix
--json, --static cannot be used togetherMutually exclusive flagsUse one of --json, --live, or --static
Amount flags are mutually exclusiveMultiple amount flags passedUse one of --eth, --usd, --percent, or --all
Invalid sort/type combinationSort doesn't support the given typeCLI prints supported options

Handling Errors in Scripts

result=$(npx @zoralabs/cli buy 0x... --eth 0.01 --yes --json 2>&1)
error=$(echo "$result" | jq -r '.error // empty')
 
if [ -n "$error" ]; then
  suggestion=$(echo "$result" | jq -r '.suggestion // empty')
  echo "Failed: $error"
  [ -n "$suggestion" ] && echo "Hint: $suggestion"
  exit 1
fi
 
echo "Trade successful: $(echo "$result" | jq -r '.txHash')"