Skip to main content

UreqError

Type Alias UreqError 

Source
pub type UreqError = Error<Error>;
Expand description

Errors returned by UreqClient.

Aliased Type§

pub enum UreqError {
    Validation {
        field: String,
        message: String,
    },
    Configuration(String),
    Transport(Error),
    Timeout {
        timeout: Duration,
    },
    Decode {
        status: StatusCode,
        request_id: Option<String>,
        headers: Box<HeaderMap>,
        body: Vec<u8>,
        source: Error,
    },
    Api {
        status: StatusCode,
        request_id: Option<String>,
        headers: Box<HeaderMap>,
        body: Vec<u8>,
        retry_after: Option<Duration>,
        attempts: u64,
    },
    IncompleteEvaluation,
}

Variants§

§

Validation

The request violates a documented API constraint.

Fields

§field: String

Field containing the invalid value.

§message: String

Description of the constraint.

§

Configuration(String)

The client configuration is invalid.

§

Transport(Error)

The HTTP exchange failed before a response was available.

§

Timeout

The configured per-attempt timeout elapsed.

Fields

§timeout: Duration

Timeout configured for each attempt.

§

Decode

A successful HTTP response could not be decoded.

Fields

§status: StatusCode

HTTP status returned by the API.

§request_id: Option<String>

Value of the request id response header, when present.

§headers: Box<HeaderMap>

HTTP response headers.

§body: Vec<u8>

Raw response bytes.

§source: Error

JSON decoding error.

§

Api

The API returned a non-success status.

Fields

§status: StatusCode

HTTP status returned by the API.

§request_id: Option<String>

Value of the request id response header, when present.

§headers: Box<HeaderMap>

HTTP response headers.

§body: Vec<u8>

Raw response bytes, including non-JSON bodies.

§retry_after: Option<Duration>

Requested server retry delay, when supplied and valid.

§attempts: u64

Total attempts made, including the initial request.

§

IncompleteEvaluation

An application-supplied event sequence ended before a terminal event.