Skip to content

Instantly share code, notes, and snippets.

@reem
Created October 11, 2014 08:03
Show Gist options
  • Save reem/de638ed0b043657f6f1b to your computer and use it in GitHub Desktop.
Save reem/de638ed0b043657f6f1b to your computer and use it in GitHub Desktop.
impl Handler for fn(&mut Request) -> IronResult<Response> {
fn call(&self, req: &mut Request) -> IronResult<Response> {
(*self)(req)
}
fn catch(&self, _: &mut Request, err: IronError) -> (Response, IronResult<()>) {
(Response::status(status::InternalServerError), Err(err))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment