use layout for internal errors
This commit is contained in:
parent
ee92301fb9
commit
70cb8319d6
|
@ -1 +1,7 @@
|
|||
500 :(
|
||||
{{#> layout }}
|
||||
<h2>Error</h2>
|
||||
|
||||
<p>Looks like something went wrong :(</p>
|
||||
|
||||
<p><strong>Error:</strong> {{internal_error}}</p>
|
||||
{{/layout}}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
{{#> layout }}
|
||||
{{/layout}}
|
|
@ -93,7 +93,7 @@ impl MyResponse {
|
|||
pub fn ise(e: failure::Error) -> Self {
|
||||
println!("Internal error: {:?}", e);
|
||||
let ctx = templates::FiveHundred{
|
||||
error: format!("{}", e),
|
||||
internal_error: e.to_string(),
|
||||
version: env!("VERGEN_SEMVER").to_string(),
|
||||
commit: env!("VERGEN_SHA_SHORT").to_string(),
|
||||
};
|
||||
|
@ -135,7 +135,7 @@ mod templates {
|
|||
|
||||
#[derive(Serialize)]
|
||||
pub struct FiveHundred {
|
||||
pub error: String,
|
||||
pub internal_error: String,
|
||||
pub commit: String,
|
||||
pub version: String,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue