unpack_client_error

Function unpack_client_error 

Source
pub fn unpack_client_error<E>(err: &E) -> Option<ClientError>
where E: Error + 'static,
Expand description

Walks the source chain of err looking for a ClientError.

At each step, two locations are checked:

  • Direct: the error itself is a ClientError.
  • Packed in io::Error: the error is an io::Error whose custom inner value is a ClientError.

Use this in put_object implementations to reclassify body-stream errors as crate::error::Error::Client instead of an opaque server error.