Enum actix_plus_error::ResponseError[][src]

pub enum ResponseError {
    InternalServerError(Box<dyn DowncastableError>),
    StatusCodeError {
        code: StatusCode,
        message: String,
    },
}

This type facilitates propagation of both internal server errors and status code errors. The former take place when something goes wrong in the backend that isn’t due to user error but nonetheless prevents a normal response (e.g. error contacting the database, a file on the backend server was not found). The latter is when an error takes place in a function that corresponds to a particular response to the user, for example if a function is called to get a row from a database that does not exist a StatusCodeError variant may be emitted with a 404 Not Found, thus allowing the caller to simply propogate this error via ? to the route and thus to the user.

Variants

InternalServerError(Box<dyn DowncastableError>)
StatusCodeError

Fields of StatusCodeError

code: StatusCodemessage: String

Trait Implementations

impl Debug for ResponseError[src]

impl Display for ResponseError[src]

impl<T: DowncastableError + 'static> From<T> for ResponseError[src]

impl ResponseError for ResponseError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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