Error Handling
The main error types in this package are:
NetworkErrorfor HTTP or WebSocket transport failuresValidationErrorfor schema mismatchesApiErrorfor indexer or node-level API failuresUserErrorfor invalid local usage
Recommended Pattern
from dydx.core import ApiError, NetworkError, UserError, ValidationError
try:
...
except ValidationError:
...
except UserError:
...
except ApiError:
...
except NetworkError:
...
Notes
- indexer HTTP failures are wrapped as
ApiError(status, result) - node gRPC failures are also normalized into
ApiError batch_cancel_ordersmay raiseUserErrorfor unsupported order shapes, such as non-short-term batch cancels