#[non_exhaustive]pub struct CallError {
pub code: ErrCode,
pub message: String,
pub status: u16,
pub graphql_errors: Vec<Value>,
pub grpc_details: Vec<Any>,
/* private fields */
}Expand description
Error returned when a generated service client call fails.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: ErrCodeCanonical Encore error code for the failure.
Taken from the service’s Encore error body or gRPC status when present;
otherwise mapped from the HTTP status (for example, NotFound for 404,
or Unavailable for a proxy 502 on gRPC), DeadlineExceeded on
timeout, or Unavailable when no response was received.
message: StringHuman-readable error message from the service or client.
status: u16HTTP status code associated with the error.
For HTTP error responses this is the returned status code; for gRPC and
GraphQL errors it is the HTTP status mapped from code; 0 if the
call failed before receiving a response or while reading the body.
graphql_errors: Vec<Value>Raw error entries from a GraphQL response (each typically containing
message, and optionally path, locations, and extensions). Empty
for non-GraphQL errors.
For GraphQL failures, code is taken from the first error’s
extensions.code if it matches an Encore error code, or Unknown
otherwise.
grpc_details: Vec<Any>Structured google.rpc.Status error details returned by a gRPC service
(decode each Any with to_msg). Empty for non-gRPC errors.
Implementations§
Trait Implementations§
Source§impl Error for CallError
The error the call failed with, as reqwest’s, tonic’s or serde_json’s, when
there was one: an error answer has none.
impl Error for CallError
The error the call failed with, as reqwest’s, tonic’s or serde_json’s, when there was one: an error answer has none.
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()
Auto Trait Implementations§
impl !RefUnwindSafe for CallError
impl !UnwindSafe for CallError
impl Forget for CallError
impl Freeze for CallError
impl Move for CallError
impl Send for CallError
impl Sync for CallError
impl Unpin for CallError
impl UnsafeUnpin for CallErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<Any>: UnsafeUnpin,
*const ArcInner<dyn Error + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Error + Sync + Send>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request