Exceptions
CTFdError
Bases: Exception
Base exception for every error raised by this client.
CTFdAPIError(status_code, message='', errors=None, payload=None)
Bases: CTFdError
The CTFd API returned a non-success HTTP response.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
HTTP status code returned by the server. |
|
message |
Human-readable error message extracted from the response body. |
|
errors |
Per-field validation errors, when CTFd returns them. |
|
payload |
Raw decoded response body, when available. |
Source code in ctfd/exceptions.py
CTFdAuthenticationError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned when the API rejects the credentials (HTTP 401).
Source code in ctfd/exceptions.py
CTFdPermissionError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned when the API forbids the operation (HTTP 403).
Source code in ctfd/exceptions.py
CTFdNotFoundError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned when the requested resource does not exist (HTTP 404).
Source code in ctfd/exceptions.py
CTFdValidationError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned when the API rejects the request body (HTTP 400).
Source code in ctfd/exceptions.py
CTFdRateLimitError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned when the API rate-limits the client (HTTP 429).
Source code in ctfd/exceptions.py
CTFdServerError(status_code, message='', errors=None, payload=None)
Bases: CTFdAPIError
Returned for HTTP 5xx responses.