summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/routes.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-31 18:02:31 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-02-01 11:41:12 -0800
commit50a2774a02993b36838e4672d395a314233c4f16 (patch)
tree3054ad17dfd6d6090bdfd9f99cbb31d8aa820fde /python/fatcat_web/routes.py
parent05f985e83a9d6bfeb05b94e7ea058bb1dc360249 (diff)
downloadfatcat-50a2774a02993b36838e4672d395a314233c4f16.tar.gz
fatcat-50a2774a02993b36838e4672d395a314233c4f16.zip
better flask error pages
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r--python/fatcat_web/routes.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 21f81eae..d712be01 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -429,6 +429,25 @@ def auth_account():
def page_not_found(e):
return render_template('404.html'), 404
+@app.errorhandler(401)
+@app.errorhandler(403)
+def page_not_authorized(e):
+ return render_template('403.html'), 403
+
+@app.errorhandler(409)
+def page_edit_conflict(e):
+ return render_template('409.html'), 409
+
+@app.errorhandler(500)
+def page_server_error(e):
+ return render_template('500.html'), 500
+
+@app.errorhandler(502)
+@app.errorhandler(503)
+@app.errorhandler(504)
+def page_server_down(e):
+ return render_template('503.html'), 503
+
@app.route('/', methods=['GET'])
def homepage():
return render_template('home.html')