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

# Error Handling

> Understand how errors are returned and handled in the Monei Python SDK.

# Overview

All SDK methods raise a `MoneiError` on failure. Always wrap calls in try/except:

```python theme={null}
from monei import MoneiClient, MoneiError

try:
    tx = monei.payout.bank_transfer({...})
except MoneiError as err:
    print(err.status_code)   # HTTP status code
    print(err.message)       # Human-readable error
    print(err.code)          # Machine-readable error code
```

### Common Error Codes

| Code                 | HTTP Status | Meaning                                      |
| -------------------- | ----------- | -------------------------------------------- |
| `UNAUTHORIZED`       | 401         | Missing or invalid API key / bearer token    |
| `FORBIDDEN`          | 403         | Insufficient permissions or KYC tier too low |
| `NOT_FOUND`          | 404         | Resource does not exist                      |
| `VALIDATION_ERROR`   | 422         | Invalid request body                         |
| `INSUFFICIENT_FUNDS` | 400         | Wallet balance too low                       |
| `RATE_LIMITED`       | 429         | Too many requests — back off and retry       |
| `INTERNAL_ERROR`     | 500         | Something went wrong on our end              |

***
