> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Python — Error Handling

## Error Handling

```python theme={null}
from polynode import PolyNode, ApiError, WsError, PolyNodeError

try:
    pn.market("invalid-id")
except ApiError as e:
    print(e.status)   # 404
    print(e.message)  # "Market not found"
except PolyNodeError as e:
    print(e.message)  # base error class
```
