Merge pull request 'Fixes #1061 Render 404 when page not found' (#1062) from render-404 into main

Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/1062
This commit is contained in:
KitaitiMakoto 2022-05-04 12:23:04 +00:00
commit 9ae3057106

View File

@ -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),
}
}