Struct perseus::errors::BlamedError
source · pub struct BlamedError<E: Send + Sync> {
pub error: E,
pub blame: ErrorBlame,
}
Expand description
An error that has an attached cause that blames either the client or the
server for its occurrence. You can convert any error into this with
.into()
or ?
, which will set the cause to the server by default,
resulting in a 500 Internal Server Error HTTP status code. If this isn’t
what you want, you’ll need to initialize this explicitly.
Note for those using anyhow
: use .map_err(|e| anyhow::anyhow!(e))?
to use anyhow in Perseus render functions.
Fields§
§error: E
The underlying error.
blame: ErrorBlame
Who is to blame for the error.
Trait Implementations§
Auto Trait Implementations§
impl<E> RefUnwindSafe for BlamedError<E>where E: RefUnwindSafe,
impl<E> Send for BlamedError<E>
impl<E> Sync for BlamedError<E>
impl<E> Unpin for BlamedError<E>where E: Unpin,
impl<E> UnwindSafe for BlamedError<E>where E: 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