Enum Error
#[non_exhaustive]pub enum Error {
Show 16 variants
StatusCode(u16),
Http(Error),
BadUri(String),
Protocol(Error),
Io(Error),
Timeout(Timeout),
HostNotFound,
RedirectFailed,
InvalidProxyUrl,
ConnectionFailed,
BodyExceedsLimit(u64),
TooManyRedirects,
RequireHttpsOnly(String),
LargeResponseHeader(usize, usize),
ConnectProxyFailed(String),
TlsRequired,
}
dep_ureq
only.Expand description
Errors from ureq.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StatusCode(u16)
When http_status_as_error()
is true,
4xx and 5xx response status codes are translated to this error.
This is the default behavior.
Http(Error)
Errors arising from the http-crate.
These errors happen for things like invalid characters in header names.
BadUri(String)
Error if the URI is missing scheme or host.
Protocol(Error)
An HTTP/1.1 protocol error.
This can happen if the remote server ends incorrect HTTP data like missing version or invalid chunked transfer.
Io(Error)
Error in io such as the TCP socket.
Timeout(Timeout)
Error raised if the request hits any configured timeout.
By default no timeouts are set, which means this error can’t happen.
HostNotFound
Error when resolving a hostname fails.
RedirectFailed
A redirect failed.
This happens when ureq encounters a redirect when sending a request body such as a POST request, and receives a 307/308 response. ureq refuses to redirect the POST body and instead raises this error.
InvalidProxyUrl
Error when creating proxy settings.
ConnectionFailed
A connection failed.
BodyExceedsLimit(u64)
A send body (Such as &str
) is larger than the content-length
header.
TooManyRedirects
Too many redirects.
The error can be turned off by setting
max_redirects_will_error()
to false. When turned off, the last response will be returned instead of causing
an error, even if it is a redirect.
The number of redirects is limited to 10 by default.
RequireHttpsOnly(String)
The setting https_only
is true and
the URI is not https.
LargeResponseHeader(usize, usize)
The response header, from status up until body, is too big.
ConnectProxyFailed(String)
Attempt to connect to a CONNECT proxy failed.
TlsRequired
The protocol requires TLS (https), but the connector did not create a TLS secured transport.
This typically indicates a fault in bespoke Connector
chains.
Implementations§
Trait Implementations§
§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)> ⓘ
fn source(&self) -> Option<&(dyn Error + 'static)> ⓘ
1.0.0 · Source§fn description(&self) -> &str ⓘ
fn description(&self) -> &str ⓘ
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more