HTTPError
An error raised when an HTTP request fails or its response has an unexpected status code.
status is nil when no response was received (connection, TLS, timeout, ...).
lua
HTTPError( 404, "https://example.com/a" ) -- "HTTP 404 Not Found - Resource not found (url: https://example.com/a)"
HTTPError( nil, "https://example.com/a", "Timeout was reached" ) -- "HTTP request failed: Timeout was reached (url: https://example.com/a)"
HTTPError.Messages[ 429 ] -- "Too Many Requests - Rate limit exceeded"Constructor
HTTPError(status: ( integer | nil ), url: ( string | nil ), message: ( string | nil )): HTTPErrorFields
| Name | Type | Description |
|---|---|---|
message | string | nil | The reason of the failure, or extra details about the status code. |
status | integer | nil | The response status code, nil if no response was received. |
url | string | nil | The URL of the request. |
Messages | table<integer, string> | The status code description lookup table. |