#[non_exhaustive]pub enum ClientError {
Show 17 variants
Request(Error),
Json(Error),
NoMock(String, String),
CircuitBreakerOpen,
FaultInjected(String),
ThrottledLocally {
host: String,
},
ReplayedRequestFailure(String),
BlockedDuringReplay(String, String),
SsrfBlocked(String),
TooManyRedirects(usize),
RedirectRejected(String),
InvalidUrl(String),
IncompatiblePinRedirect(&'static str),
PinRequiresDomainHost(&'static str),
PinNotAllowedWithSsrfSafe(&'static str),
SimNetwork(String),
DeadlineExceeded,
}Expand description
Errors produced by Client and RequestBuilder.
#[non_exhaustive]: match it with a _ arm, so a new variant is not a
breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Request(Error)
An underlying reqwest transport error.
Json(Error)
JSON (de)serialisation failed.
NoMock(String, String)
No mock entry matched the outgoing request.
CircuitBreakerOpen
The outbound circuit breaker is open.
FaultInjected(String)
A staging fault ([fault_injection], target http) failed the call
before it was sent.
ThrottledLocally
The client-side adaptive throttle rejected the attempt locally,
because the host rejected too many recent attempts (issue #3068).
See [http.client.adaptive_throttle].
ReplayedRequestFailure(String)
The capsule recorded a transport failure for this call, and replay reproduced it (#1634).
A recorded transport error cannot be rebuilt as a reqwest::Error — it
has no public constructor — but it must not be downgraded to a status
either: a handler whose bug is “we do not handle a connection reset”
has to meet the reset again.
Its Display is the recorded text exactly, with no replay marker of
its own. A handler that propagates this error puts the text into the
capsule’s outcome, and the replay verdict compares outcome messages
verbatim — so a marker here would report an unchanged failure as a
mismatch, which is the one thing the comparison exists to get right.
BlockedDuringReplay(String, String)
Outbound HTTP is blocked because this process is replaying a failure
capsule (see the crate-internal block_outbound_for_replay).
SsrfBlocked(String)
A resolved connection target (or redirect target) is a blocked
(private / link-local / loopback / reserved) IP address per the built-in
SSRF policy. See is_blocked_ip.
TooManyRedirects(usize)
A redirect chain exceeded the configured maximum number of hops.
RedirectRejected(String)
A redirect’s absolute Location target was rejected by the caller’s
validator (or by the built-in scheme-downgrade guard).
InvalidUrl(String)
A URL could not be parsed, was missing a host, or DNS resolution failed while composing a custom (redirect / pin / SSRF-safe) request.
IncompatiblePinRedirect(&'static str)
pin_to was combined with
follow_redirects — an incompatible
pair. A single pinned SocketAddr only covers the first hop; later
redirect hops re-resolve via normal DNS, so following a cross-host 3xx
would silently escape the pin and defeat its purpose. Use
Client::get_ssrf_safe for pinned, per-hop-revalidated redirect
following; pin_to alone (returns the 3xx unfollowed); or
follow_redirects without pin_to.
PinRequiresDomainHost(&'static str)
pin_to was used on a request whose URL host is
an IP literal. reqwest/hyper treat an IP-literal host as already-resolved
and never consult the DNS resolver, so the resolve_to_addrs override
that installs the pin is skipped and the socket connects to the literal in
the URL — not the pinned address — silently bypassing the pin. pin_to
therefore requires a domain (hostname) host; put the desired IP directly
in the URL, or use a domain host. (get_ssrf_safe never sets a pin: it
validates the literal and connects to that same IP, so it is unaffected.)
PinNotAllowedWithSsrfSafe(&'static str)
pin_to was combined with
Client::get_ssrf_safe — an incompatible pair. The SSRF-safe path runs
its own per-hop resolve→validate→pin and never reads the caller’s
pin_to address, so an explicit pin would be silently ignored. Use
pin_to alone for a caller-chosen fixed address, or get_ssrf_safe
alone for guarded automatic per-hop pinning — not both.
SimNetwork(String)
The simulated network (crate::sim::SimNet, issue #2967) failed the
call: a drop, a partition, a timeout, a host it does not know, or a
request or response it could not build.
DeadlineExceeded
The request deadline passed before an attempt could start (issue
#3058). See crate::deadline.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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
use the Display impl or to_string()
Source§impl From<Error> for ClientError
impl From<Error> for ClientError
Auto Trait Implementations§
impl !RefUnwindSafe for ClientError
impl !UnwindSafe for ClientError
impl Freeze for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> AutumnCounterCaches for Twhere
T: 'static,
impl<T> AutumnCounterCaches for Twhere
T: 'static,
Source§const HAS_COUNTER_CACHES: bool = false
const HAS_COUNTER_CACHES: bool = false
Source§fn counter_caches() -> &'static [CounterCacheSpec<Self>]
fn counter_caches() -> &'static [CounterCacheSpec<Self>]
Source§impl<T> AutumnDependents for Twhere
T: ?Sized,
impl<T> AutumnDependents for Twhere
T: ?Sized,
Source§fn dependents() -> &'static [RuntimeDependentSpec]
fn dependents() -> &'static [RuntimeDependentSpec]
#[model] overrides via an inherent shadow when dependents exist.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Stream] with the returned rows. Read moreSource§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Vec with the affected rows. Read moreSource§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.