summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2022-01-10 22:01:12 +0100
committerSamantaz Fox <coding@samantaz.fr>2022-01-16 16:15:23 +0100
commit34a79c5f1e54923caee8fbe8396f7b91228fa46e (patch)
tree1259cb50b7860219d5b15f345e8772a9c54b5da6 /src
parentfd30f5775af678e843ec8084c7b11f7d5e0e1ca9 (diff)
downloadinvidious-34a79c5f1e54923caee8fbe8396f7b91228fa46e.tar.gz
invidious-34a79c5f1e54923caee8fbe8396f7b91228fa46e.tar.bz2
invidious-34a79c5f1e54923caee8fbe8396f7b91228fa46e.zip
Don't show "next steps" message with a stack trace
Usually, next steps are after the error message. Here, we want the same options to be right above the stack trace, so users are less likely to report duplicates.
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/errors.cr10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr
index dbcc6068..d441165d 100644
--- a/src/invidious/helpers/errors.cr
+++ b/src/invidious/helpers/errors.cr
@@ -43,6 +43,8 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_
url_faq = "https://github.com/iv-org/documentation/blob/master/FAQ.md"
url_search_issues = "https://github.com/iv-org/invidious/issues"
+ url_switch = "https://redirect.invidious.io" + env.request.resource
+
url_new_issue = "https://github.com/iv-org/invidious/issues/new"
url_new_issue += "?labels=bug&template=bug_report.md&title="
url_new_issue += URI.encode_www_form("[Bug] " + issue_title)
@@ -52,8 +54,10 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_
<h2>#{translate(locale, "crash_page_you_found_a_bug")}</h2>
<br/><br/>
- <p>#{translate(locale, "crash_page_before_reporting")}</p>
+ <p><b>#{translate(locale, "crash_page_before_reporting")}</b></p>
<ul>
+ <li><a href="#{env.request.resource}">#{translate(locale, "crash_page_refresh")}</a></li>
+ <li><a href="#{url_switch}">#{translate(locale, "crash_page_switch_instance")}</a></li>
<li>#{translate(locale, "crash_page_read_the_faq", url_faq)}</li>
<li>#{translate(locale, "crash_page_search_issue", url_search_issues)}</li>
</ul>
@@ -66,7 +70,9 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_
</div>
END_HTML
- next_steps = error_redirect_helper(env, locale)
+ # Don't show the usual "next steps" widget. The same options are
+ # proposed above the error message, just worded differently.
+ next_steps = ""
return templated "error"
end