The package logs the error and returns null. Structuring the exceptions to distinguish between client-side and server-side errors from OpenCage API would help to react to HTTP errors.
| code |
meaning |
| 200 |
OK (zero or more results will be returned) |
| 400 |
Invalid request (bad request; a required parameter is missing; invalid coordinates; invalid version; invalid format) |
| 401 |
Unable to authenticate - missing, invalid, or unknown API key |
| 402 |
Valid request but quota exceeded (payment required) |
| 403 |
Forbidden (API key disabled or IP address rejected) |
| 404 |
Invalid API endpoint |
| 405 |
Method not allowed (non-GET request) |
| 408 |
Timeout; you can try again |
| 410 |
Request too long |
| 426 |
Upgrade required (unsupported TLS) |
| 429 |
Too many requests (too quickly, rate limiting) |
| 503 |
Internal server error |
Error code can be found at https://opencagedata.com/api#codes