#[non_exhaustive]pub struct ErrorResponse {
pub status: StatusCode,
pub headers: HeaderMap,
pub body: String,
pub message: String,
pub retry_after: Option<Duration>,
}Expand description
An unsuccessful response, read whole: what ApiError::Response carries.
The send loop builds one when the client’s policy fails a response, and a
venue’s From<ApiError> decodes its own body shape from body.
Its Debug, which the Request failed ERROR line prints, names the
headers without their values and truncates the message and the body.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: StatusCodeThe response’s status.
headers: HeaderMapThe response’s headers.
body: StringThe response’s body, verbatim, or "" when it could not be read.
message: StringThe body’s error field, else its message field, else the body
verbatim: the shape most venue hosts answer with.
retry_after: Option<Duration>The response’s Retry-After, read by
polyoxide_venue::parse_retry_after with no clamp, since it is
surfaced, never slept on. A zero is None.
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
Trait Implementations§
Source§impl Clone for ErrorResponse
impl Clone for ErrorResponse
Source§impl Debug for ErrorResponse
Written by hand so a log line never carries a header’s value (a token, a
cookie) or an unbounded body.
impl Debug for ErrorResponse
Written by hand so a log line never carries a header’s value (a token, a cookie) or an unbounded body.