Friendlier error message when Tor is closed or network is down

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor
2021-07-03 21:31:45 -07:00
committed by Jesús
parent 7f67af1031
commit aadc20fa19
2 changed files with 28 additions and 3 deletions

View File

@@ -108,6 +108,12 @@ def error_page(e):
if exc_info()[1].ip:
error_message += '\n\nExit node IP address: ' + exc_info()[1].ip
return flask.render_template('error.html', error_message=error_message, slim=slim), 502
elif exc_info()[0] == util.FetchError and exc_info()[1].error_message:
return (flask.render_template(
'error.html',
error_message=exc_info()[1].error_message,
slim=slim
), 502)
return flask.render_template('error.html', traceback=traceback.format_exc(), slim=slim), 500