From b7ea154e510977257dae822d4643cba845a4e196 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Wed, 4 May 2022 21:21:58 +0900 Subject: [PATCH] Render 404 when page not found --- src/routes/errors.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/errors.rs b/src/routes/errors.rs index 74dc4dd5..8d69d0b5 100644 --- a/src/routes/errors.rs +++ b/src/routes/errors.rs @@ -21,8 +21,9 @@ impl<'r> Responder<'r> for ErrorPage { warn!("{:?}", self.0); match self.0 { - Error::NotFound => Err(Status::NotFound), - Error::Unauthorized => Err(Status::NotFound), + Error::NotFound | Error::Unauthorized | Error::Db(diesel::result::Error::NotFound) => { + Err(Status::NotFound) + } _ => Err(Status::InternalServerError), } }