[−][src]Trait gotham::handler::IntoHandlerError
Allows conversion into a HandlerError from an implementing type.
Futures returned from handlers can resolve to an error type with a value of (State, HandlerError)
.
fn my_handler(state: State) -> Pin<Box<HandlerFuture>> { match File::open("config.toml") { Err(e) => future::err((state, e.into_handler_error())).boxed(), Ok(_) => // Create and return a response } }
Required methods
fn into_handler_error(self) -> HandlerError
Convert self
into a HandlerError
.
The return value will have a 500 Internal Server Error
as the HTTP status code. See
HandlerError::with_status
for an example of changing it.
Implementors
impl<E> IntoHandlerError for E where
E: Error + Send + 'static,
[src]
E: Error + Send + 'static,