| 115 | } |
| 116 | |
| 117 | pub fn bad_request<B>(res: dev::ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> { |
| 118 | let new_resp = NamedFile::open("static/errors/400.html")? |
| 119 | .customize() |
| 120 | .with_status(res.status()) |
| 121 | .respond_to(res.request()) |
| 122 | .map_into_boxed_body() |
| 123 | .map_into_right_body(); |
| 124 | |
| 125 | Ok(ErrorHandlerResponse::Response(res.into_response(new_resp))) |
| 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")? |