This commit is contained in:
parent
410a602638
commit
25aea0f04d
19
src/error.rs
19
src/error.rs
@ -41,16 +41,15 @@ impl ResponseError for Error {
|
||||
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
let mut buf = Vec::new();
|
||||
if let Error::BranchNotFound = self {
|
||||
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::NotFound().content_type("text/html").body(buf)
|
||||
}
|
||||
else {
|
||||
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::InternalServerError()
|
||||
.content_type("text/html")
|
||||
.body(buf)
|
||||
}
|
||||
if let Error::BranchNotFound = self {
|
||||
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::NotFound().content_type("text/html").body(buf)
|
||||
} else {
|
||||
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::InternalServerError()
|
||||
.content_type("text/html")
|
||||
.body(buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user