diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-10-20 18:24:41 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-10-20 18:24:41 -0700 |
commit | c696db3e84d91092182adbeb7eef6126fad6be5d (patch) | |
tree | 7ac3af26887bc5350c9e2b20a65f86ffeed1a556 /youtube/__init__.py | |
parent | 95f2f027eabdcc4dc3c1a77829bf2bf503ed2939 (diff) | |
download | yt-local-c696db3e84d91092182adbeb7eef6126fad6be5d.tar.lz yt-local-c696db3e84d91092182adbeb7eef6126fad6be5d.tar.xz yt-local-c696db3e84d91092182adbeb7eef6126fad6be5d.zip |
comments.js: include error in reply html rather than using an alert
Diffstat (limited to 'youtube/__init__.py')
-rw-r--r-- | youtube/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube/__init__.py b/youtube/__init__.py index 70ed5b2..61039d3 100644 --- a/youtube/__init__.py +++ b/youtube/__init__.py @@ -1,5 +1,6 @@ from youtube import util import flask +from flask import request import settings import traceback import re @@ -55,6 +56,7 @@ def timestamps(text): @yt_app.errorhandler(500) def error_page(e): + slim = request.args.get('slim', False) # whether it was an ajax request if (exc_info()[0] == util.FetchError and exc_info()[1].code == '429' and settings.route_tor @@ -64,8 +66,8 @@ def error_page(e): ' using the New Identity button in the Tor Browser.') if exc_info()[1].ip: error_message += ' Exit node IP address: ' + exc_info()[1].ip - return flask.render_template('error.html', error_message=error_message), 502 - return flask.render_template('error.html', traceback=traceback.format_exc()), 500 + return flask.render_template('error.html', error_message=error_message, slim=slim), 502 + return flask.render_template('error.html', traceback=traceback.format_exc(), slim=slim), 500 font_choices = { 0: 'initial', |