Update `Catcher` example: returns Status::NotFound on 404.

This commit is contained in:
Alan Stoate 2017-03-10 09:52:32 +10:30 committed by Sergio Benitez
parent 40c5f28331
commit cb41ffc033
1 changed files with 3 additions and 1 deletions

View File

@ -79,9 +79,11 @@ impl Catcher {
/// # #![allow(unused_variables)]
/// use rocket::{Catcher, Request, Error};
/// use rocket::response::{Result, Responder};
/// use rocket::response::status::Custom;
/// use rocket::http::Status;
///
/// fn handle_404<'r>(_: Error, req: &'r Request) -> Result<'r> {
/// format!("Couldn't find: {}", req.uri()).respond()
/// Custom(Status::NotFound, format!("Couldn't find: {}", req.uri())).respond()
/// }
///
/// fn handle_500<'r>(_: Error, _: &'r Request) -> Result<'r> {