scallop-error-handlinglisted
Install: claude install-skill scallop-io/scallop-skills
# Error Handling
Understand and handle errors from the Scallop Python SDK.
## Exception Hierarchy
```
ScallopError (base)
├── ScallopConfigError — Configuration/setup issues
├── ScallopQueryError — Read operation failures
│ └── ObligationNotFoundError — Obligation doesn't exist on-chain
├── ScallopTransactionError — Transaction execution failures
│ ├── ObligationLockedError — Obligation staked in borrow incentive
│ ├── InsufficientBalanceError— Not enough coins
│ ├── ZeroAmountError — Amount must be > 0
│ └── LiquidationError — Liquidation failures
│ └── NotLiquidatableError— Position is healthy
├── UnsupportedCoinError — Unknown coin name/type
├── OraclePriceError — Price feed failure
└── NetworkError — RPC connection failures
```
All exceptions inherit from `ScallopError`, so you can catch broadly or narrowly.
## Import and Basic Usage
```python
# These are in the public API (importable from sui_scallop_sdk directly):
from sui_scallop_sdk import (
ScallopError,
ScallopConfigError,
ScallopQueryError,
ScallopTransactionError,
ObligationNotFoundError,
UnsupportedCoinError,
)
# These must be imported from the exceptions module directly:
from sui_scallop_sdk.exceptions import (
ObligationLockedError,
InsufficientBalanceError,
ZeroAmountError,
OraclePriceError,
LiquidationError,
NotLiquidatableError,
NetworkError,
parse_scallop_er