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 {
|
fn error_response(&self) -> HttpResponse {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
if let Error::BranchNotFound = self {
|
if let Error::BranchNotFound = self {
|
||||||
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||||
HttpResponse::NotFound().content_type("text/html").body(buf)
|
HttpResponse::NotFound().content_type("text/html").body(buf)
|
||||||
}
|
} else {
|
||||||
else {
|
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||||
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
HttpResponse::InternalServerError()
|
||||||
HttpResponse::InternalServerError()
|
.content_type("text/html")
|
||||||
.content_type("text/html")
|
.body(buf)
|
||||||
.body(buf)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user