Skip to content

Invidious is an alternative front-end to YouTube

Improve error message for 500 and add redirect for 404

Omar Rothdfd17bdd8823
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:[email protected]">
+ </a>.
+ END_HTML
templated "error"
end