HttpError
struct HttpErrorRaised by Response.raise_for_status() on non-2xx responses.
Fields:
status: The HTTP status code (e.g. 404, 500).
reason: The HTTP reason phrase (e.g. "Not Found").
url: The URL that returned the error (empty if unknown).
Example:
raise HttpError(404, "Not Found", "https://example.com/missing")
Implements Copyable, Movable, Writable
- Fields
status: Intreason: Stringurl: String
__init__
def __init__(out self, status: Int, reason: String = "", url: String = "") Initialise an HttpError.
- Args
status: HTTP status code (e.g. 404).reason: HTTP reason phrase (e.g."Not Found").url: URL that returned the error.
write_to
def write_to[W: Writer, //](self, mut writer: W) Write the error description to writer.
- Args
writer: Destination writer.