HttpError

Trait HttpError 

Source
pub trait HttpError:
    Error
    + Send
    + 'static {
    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn error_type(&self) -> HttpErrorType { ... }
    fn http_description(&self) -> String { ... }
    fn status_code(&self) -> StatusCode { ... }
}
Expand description

Error trait for any service error

§Example implementation

impl HttpError for MyError {}

Provided Methods§

Source

fn name(&self) -> &'static str

Name of this error (type name by default)

Source

fn error_type(&self) -> HttpErrorType

How should this error be handled, check HttpErrorType for more info (User by default)

Source

fn http_description(&self) -> String

Provides HTTP-friendly description of this error (.to_string() by default)

Source

fn status_code(&self) -> StatusCode

Which status code should be used for this error

Trait Implementations§

Source§

impl<E: HttpError> From<E> for Box<dyn HttpError>

Source§

fn from(value: E) -> Box<dyn HttpError>

Converts to this type from the input type.

Implementations on Foreign Types§

Source§

impl HttpError for Infallible

Source§

impl HttpError for FromUtf8Error

Source§

impl HttpError for Error

Source§

impl HttpError for JoinError

Implementors§