pub trait HttpError:
Error
+ Send
+ Sync
+ 'static {
// Provided methods
fn log(&self) { ... }
fn status(&self) -> StatusCode { ... }
fn reason(&self) -> String { ... }
fn type_name(&self) -> &str { ... }
}
Expand description
This trait should be implemented by error types that can be used as HTTP error responses
Provided Methods§
Sourcefn status(&self) -> StatusCode
fn status(&self) -> StatusCode
Handles determining the HTTP status code that should be used for the HTTP response
Defaults to StatusCode::INTERNAL_SERVER_ERROR
Sourcefn reason(&self) -> String
fn reason(&self) -> String
Handles creating the error response “reason” text that is included in the error
Sourcefn type_name(&self) -> &str
fn type_name(&self) -> &str
Provides the full type name for the actual error type thats been erased by dynamic typing (For better error source clarity) used by the Debug implementation of DynHttpError