pub enum Error {
    Responder(Response),
    Normal(Box<dyn StdError + Send + Sync>),
    Report(Box<dyn StdError + Send + Sync>, Response),
}Expand description
Represents errors that can occur handling application.
Variants§
Responder(Response)
Receives a Response as error.
Normal(Box<dyn StdError + Send + Sync>)
Receives a boxed std::error::Error as error.
Report(Box<dyn StdError + Send + Sync>, Response)
Receives a boxed std::error::Error and Response pair as error.
Implementations§
source§impl Error
 
impl Error
sourcepub fn normal<T>(t: T) -> Selfwhere
    T: StdError + Send + Sync + 'static,
 
pub fn normal<T>(t: T) -> Selfwhere
    T: StdError + Send + Sync + 'static,
Create a new error object from any error type.
sourcepub fn is<T>(&self) -> boolwhere
    T: StdError + 'static,
 
pub fn is<T>(&self) -> boolwhere
    T: StdError + 'static,
Forwards to the method defined on the type dyn Error.
sourcepub fn downcast<T>(self) -> Result<T, Self>where
    T: StdError + 'static,
 
pub fn downcast<T>(self) -> Result<T, Self>where
    T: StdError + 'static,
Attempt to downcast the error object to a concrete type.
sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
    T: StdError + 'static,
 
pub fn downcast_ref<T>(&self) -> Option<&T>where
    T: StdError + 'static,
Downcast this error object by reference.
sourcepub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
    T: StdError + 'static,
 
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
    T: StdError + 'static,
Downcast this error object by mutable reference.
Trait Implementations§
source§impl Error for Error
 
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
 
fn source(&self) -> Option<&(dyn Error + 'static)>
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<CookiesError> for Error
Available on crate feature cookie only. 
impl From<CookiesError> for Error
Available on crate feature 
cookie only.source§fn from(e: CookiesError) -> Self
 
fn from(e: CookiesError) -> Self
Converts to this type from the input type.
source§impl From<Error> for Error
Available on crate feature session only. 
impl From<Error> for Error
Available on crate feature 
session only.source§fn from(e: SessionError) -> Self
 
fn from(e: SessionError) -> Self
Converts to this type from the input type.
source§impl From<Error> for Error
Available on crate feature multipart only. 
impl From<Error> for Error
Available on crate feature 
multipart only.source§fn from(e: MultipartError) -> Self
 
fn from(e: MultipartError) -> Self
Converts to this type from the input type.
source§impl From<ParamsError> for Error
Available on crate feature params only. 
impl From<ParamsError> for Error
Available on crate feature 
params only.source§fn from(e: ParamsError) -> Self
 
fn from(e: ParamsError) -> Self
Converts to this type from the input type.
source§impl From<PayloadError> for Error
 
impl From<PayloadError> for Error
source§fn from(e: PayloadError) -> Self
 
fn from(e: PayloadError) -> Self
Converts to this type from the input type.
source§impl From<WebSocketError> for Error
Available on crate feature websocket only. 
impl From<WebSocketError> for Error
Available on crate feature 
websocket only.source§fn from(e: WebSocketError) -> Self
 
fn from(e: WebSocketError) -> Self
Converts to this type from the input type.
source§impl IntoResponse for Error
 
impl IntoResponse for Error
source§fn into_response(self) -> Response
 
fn into_response(self) -> Response
Convert self to HTTP 
Response.source§fn into_error(self) -> Error
 
fn into_error(self) -> Error
Convert self to the 
Error.