sentry_rocket

Struct Error

Source
pub struct Error(/* private fields */);
Expand description

Just use this type as return error type for your handler functions (ex: Result<String, custom_derive::Error>) and after running the usual let _guard = sentry::init(...); and it will send any error to sentry. Note that you should use the failure crate to propagate your errors if you wish to have proper backtrace handling. Also, using sentry_rocket::sentry instead of sentry will ensure the versions match so that everything works properly (also, then you don’t need sentry as a dependency for your project, only sentry_rocket)

Methods from Deref<Target = Error>§

Source

pub fn as_fail(&self) -> &(dyn Fail + 'static)

Return a reference to the underlying failure that this Error contains.

Source

pub fn name(&self) -> Option<&str>

Returns the name of the underlying fail.

Source

pub fn cause(&self) -> &(dyn Fail + 'static)

👎Deprecated since 0.1.2: please use ‘as_fail()’ method instead

Returns a reference to the underlying cause of this Error. Unlike the method on Fail, this does not return an Option. The Error type always has an underlying failure.

This method has been deprecated in favor of the Error::as_fail method, which does the same thing.

Source

pub fn backtrace(&self) -> &Backtrace

Gets a reference to the Backtrace for this Error.

If the failure this wrapped carried a backtrace, that backtrace will be returned. Otherwise, the backtrace will have been constructed at the point that failure was cast into the Error type.

Source

pub fn find_root_cause(&self) -> &(dyn Fail + 'static)

Returns the “root cause” of this error - the last value in the cause chain which does not return an underlying cause.

Source

pub fn iter_causes(&self) -> Causes<'_>

Returns a iterator over the causes of this error with the cause of the fail as the first item and the root_cause as the final item.

Use iter_chain to also include the fail of this error itself.

Source

pub fn iter_chain(&self) -> Causes<'_>

Returns a iterator over all fails up the chain from the current as the first item up to the root_cause as the final item.

This means that the chain also includes the fail itself which means that it does not start with cause. To skip the outermost fail use iter_causes instead.

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: Fail,

Attempts to downcast this Error to a particular Fail type by reference.

If the underlying error is not of type T, this will return None.

Source

pub fn root_cause(&self) -> &(dyn Fail + 'static)

👎Deprecated since 0.1.2: please use the ‘find_root_cause()’ method instead

Deprecated alias to find_root_cause.

Source

pub fn causes(&self) -> Causes<'_>

👎Deprecated since 0.1.2: please use the ‘iter_chain()’ method instead

Deprecated alias to iter_causes.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Error

Source§

type Target = Error

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<Error> for Error

Source§

fn from(v: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(v: Error) -> Self

Converts to this type from the input type.
Source§

impl<'r> Responder<'r> for Error

Source§

fn respond_to(self, req: &Request<'_>) -> Result<'r>

Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, I> AsResult<T, I> for T
where I: Input,

Source§

fn as_result(self) -> Result<T, ParseErr<I>>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoCollection<T> for T

Source§

fn into_collection<A>(self) -> SmallVec<A>
where A: Array<Item = T>,

Converts self into a collection.
Source§

fn mapped<U, F, A>(self, f: F) -> SmallVec<A>
where F: FnMut(T) -> U, A: Array<Item = U>,

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Err = <U as TryFrom<T>>::Err

Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

Source§

impl<T> Typeable for T
where T: Any,

Source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T