Skip to main content

classify_reqwest

Function classify_reqwest 

Source
pub fn classify_reqwest(err: &Error) -> Class
Expand description

The class of a transport error from reqwest.

A failure in transit is Class::Network: a timeout, a failed connect, or any error with an I/O error or a body-read failure in its source chain. reqwest reports a body that broke off mid-read as a decode error, so these are checked first. An error that carries an HTTP status follows the status rule. Then a request that could not be built is Class::InvalidRequest, a body that arrived whole but did not decode is Class::Decode, and anything else is Class::Network.