pub struct BackendApiError<D = Value> {
pub kind: BackendErrorKind,
pub msg: String,
pub data: D,
pub sensitive: bool,
}Fields§
§kind: BackendErrorKind§msg: String§data: DStructured data associated with this error.
sensitive: boolWhether data contains sensitive information that Lexe
shouldn’t see (e.g. a route). Such data may still be logged by
the app or in SDKs but shouldn’t be logged inside Lexe infra.
Implementations§
Source§impl BackendApiError
impl BackendApiError
pub fn database(error: impl Display) -> Self
pub fn not_found(error: impl Display) -> Self
pub fn duplicate(error: impl Display) -> Self
pub fn unauthenticated(error: impl Display) -> Self
pub fn invalid_parsed_req(error: impl Display) -> Self
pub fn not_updatable(error: impl Display) -> Self
pub fn bcs_serialize(err: Error) -> Self
pub fn batch_size_too_large() -> Self
pub fn conversion(error: impl Display) -> Self
Trait Implementations§
Source§impl<D: Clone> Clone for BackendApiError<D>
impl<D: Clone> Clone for BackendApiError<D>
Source§fn clone(&self) -> BackendApiError<D>
fn clone(&self) -> BackendApiError<D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: Debug> Debug for BackendApiError<D>
impl<D: Debug> Debug for BackendApiError<D>
Source§impl<D: Default> Default for BackendApiError<D>
impl<D: Default> Default for BackendApiError<D>
Source§fn default() -> BackendApiError<D>
fn default() -> BackendApiError<D>
Returns the “default value” for a type. Read more
Source§impl Display for BackendApiError
impl Display for BackendApiError
Source§impl<D> Error for BackendApiError<D>
impl<D> Error for BackendApiError<D>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<BackendApiError> for ErrorResponse
impl From<BackendApiError> for ErrorResponse
Source§fn from(api_error: BackendApiError) -> Self
fn from(api_error: BackendApiError) -> Self
Converts to this type from the input type.
Source§impl From<CommonApiError> for BackendApiError
impl From<CommonApiError> for BackendApiError
Source§fn from(common_error: CommonApiError) -> Self
fn from(common_error: CommonApiError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for BackendApiError
impl From<Error> for BackendApiError
Source§impl From<ErrorResponse> for BackendApiError
impl From<ErrorResponse> for BackendApiError
Source§fn from(err_resp: ErrorResponse) -> Self
fn from(err_resp: ErrorResponse) -> Self
Converts to this type from the input type.
Source§impl<D: PartialEq> PartialEq for BackendApiError<D>
impl<D: PartialEq> PartialEq for BackendApiError<D>
Source§impl ToHttpStatus for BackendApiError
impl ToHttpStatus for BackendApiError
fn to_http_status(&self) -> StatusCode
impl<D: Eq> Eq for BackendApiError<D>
impl<D> StructuralPartialEq for BackendApiError<D>
Auto Trait Implementations§
impl<D> Freeze for BackendApiError<D>where
D: Freeze,
impl<D> RefUnwindSafe for BackendApiError<D>where
D: RefUnwindSafe,
impl<D> Send for BackendApiError<D>where
D: Send,
impl<D> Sync for BackendApiError<D>where
D: Sync,
impl<D> Unpin for BackendApiError<D>where
D: Unpin,
impl<D> UnsafeUnpin for BackendApiError<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for BackendApiError<D>where
D: UnwindSafe,
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
Mutably borrows from an owned value. Read more