#[non_exhaustive]pub struct CallError {
pub code: ErrCode,
pub message: String,
pub status: u16,
pub graphql_errors: Vec<Value>,
/* private fields */
}Expand description
A call to another service that failed: an error answer, or none at all.
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: ErrCodeThe failure’s code: the one the service answered with, in Encore’s
error body or as its gRPC status; Unavailable when no answer came;
DeadlineExceeded when the call took longer than its timeout; else
the one the answer’s HTTP status means, as NotFound for 404.
message: StringWhat went wrong, as the service said, or as the client saw.
status: u16The HTTP status of the service’s answer: the answer’s own, when it was
an error status, else (a gRPC or GraphQL error) the one Encore answers
code with. 0 when the call got no answer, or failed before it was
sent or while its answer was read.
graphql_errors: Vec<Value>A GraphQL answer’s errors, as it sent them: each an object with a
message, and often path, locations and extensions. Empty for
any other failure. Its code is the first error’s extensions.code
when that is one of Encore’s codes, and Unknown otherwise.
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 CallError
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