Caught error where you don't put Date or Time in
This commit is contained in:
@@ -32,8 +32,8 @@ fn to_blockchain_time(input_datetime: &str) -> Template {
|
||||
dt.and_utc()
|
||||
},
|
||||
Err(e) => {
|
||||
println!("error: {}", e);
|
||||
panic!();
|
||||
let err_string = format!{"{}", e};
|
||||
return Template::render("error", context!{ error: err_string });
|
||||
}
|
||||
};
|
||||
let blocktimes = vec!{
|
||||
@@ -45,7 +45,6 @@ fn to_blockchain_time(input_datetime: &str) -> Template {
|
||||
let context = context!{
|
||||
blocktimes
|
||||
};
|
||||
println!("{:?}", context);
|
||||
Template::render("blockchain_time_results", context)
|
||||
}
|
||||
|
||||
|
||||
11
templates/error.html.tera
Normal file
11
templates/error.html.tera
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "base" %}
|
||||
{% block content %}
|
||||
<h1>Error!</h1>
|
||||
<p>Error: <span class="result">{{ error }}</span></p>
|
||||
|
||||
<p>I don't know what you did</p>
|
||||
<p>Maybe that error above will make sense to you, maybe not</p>
|
||||
<p>It's probably because you up a wrong DateTime in</p>
|
||||
<p>Don't forget to put a time in - I don't know how to enforce this with HTML</p>
|
||||
<p><a href="/">Please try again</a></p>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user