pub enum ApiError {
InvalidArgument {
reason: String,
},
NotFound {
resource: String,
},
Unauthorized,
Forbidden,
Conflict {
reason: String,
},
Internal,
}Variants§
Trait Implementations§
Source§impl EnumProperty for ApiError
impl EnumProperty for ApiError
Source§impl Error for ApiError
impl Error for ApiError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for ApiError
impl ErrorCompat for ApiError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreSource§impl ErrorExt for ApiError
impl ErrorExt for ApiError
fn status_code(&self) -> StatusCode
fn as_any(&self) -> &dyn Any
fn output_msg(&self) -> Stringwhere
Self: Sized,
fn root_cause(&self) -> Option<&dyn Error>where
Self: Sized,
Source§impl<__T0> IntoError<ApiError> for ConflictSnafu<__T0>
impl<__T0> IntoError<ApiError> for ConflictSnafu<__T0>
Source§impl IntoError<ApiError> for ForbiddenSnafu
impl IntoError<ApiError> for ForbiddenSnafu
Source§impl IntoError<ApiError> for InternalSnafu
impl IntoError<ApiError> for InternalSnafu
Source§impl<__T0> IntoError<ApiError> for InvalidArgumentSnafu<__T0>
impl<__T0> IntoError<ApiError> for InvalidArgumentSnafu<__T0>
Source§impl<__T0> IntoError<ApiError> for NotFoundSnafu<__T0>
impl<__T0> IntoError<ApiError> for NotFoundSnafu<__T0>
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnwindSafe for ApiError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request