| 126 | } |
| 127 | |
| 128 | pub fn not_found<B>(res: dev::ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> { |
| 129 | let new_resp = NamedFile::open("static/errors/404.html")? |
| 130 | .customize() |
| 131 | .with_status(res.status()) |
| 132 | .respond_to(res.request()) |
| 133 | .map_into_boxed_body() |
| 134 | .map_into_right_body(); |
| 135 | |
| 136 | Ok(ErrorHandlerResponse::Response(res.into_response(new_resp))) |
| 137 | } |
| 138 | |
| 139 | pub fn internal_server_error<B>(res: dev::ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> { |
| 140 | let new_resp = NamedFile::open("static/errors/500.html")? |