diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-01-12 13:18:08 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-01-12 13:18:08 -0600 |
| commit | dfd17bdd8823cf0b1d9d7e1287371d236f406ada (patch) | |
| tree | 21e049cae38b7d686377419c516463459ee76300 | |
| parent | 0f48d221b40511b9f5ec999616af97853f587fbc (diff) | |
| download | invidious-dfd17bdd8823cf0b1d9d7e1287371d236f406ada.tar.gz invidious-dfd17bdd8823cf0b1d9d7e1287371d236f406ada.tar.bz2 invidious-dfd17bdd8823cf0b1d9d7e1287371d236f406ada.zip | |
Improve error message for 500 and add redirect for 404
| -rw-r--r-- | src/invidious.cr | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index d35cb324..6f9097fc 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3800,12 +3800,21 @@ error 404 do |env| halt env, status_code: 302 end - error_message = "404 Page not found" - templated "error" + env.response.headers["Location"] = "/" + halt env, status_code: 302 end error 500 do |env| - error_message = "500 Server error" + error_message = <<-END_HTML + Looks like you've found a bug in Invidious. Feel free to open a new issue + <a href="https://github.com/omarroth/invidious/issues/github.com/omarroth/invidious"> + here + </a> + or send an email to + <a href="mailto:omarroth@protonmail.com"> + omarroth@protonmail.com + </a>. + END_HTML templated "error" end |
