From 02a58100499988ea3500e626ed7542746df783ed Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sun, 28 Jun 2015 20:55:39 -0400 Subject: [PATCH] Adding 502 error handling --- CTFd/errors.py | 6 +++++- templates/errors/502.html | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 templates/errors/502.html diff --git a/CTFd/errors.py b/CTFd/errors.py index 877fdff2..f33a6da6 100644 --- a/CTFd/errors.py +++ b/CTFd/errors.py @@ -10,5 +10,9 @@ def init_errors(app): return render_template('errors/403.html'), 403 @app.errorhandler(500) - def forbidden(error): + def general_error(error): return render_template('errors/500.html'), 500 + + @app.errorhandler(502) + def gateway_error(error): + return render_template('errors/502.html'), 502 diff --git a/templates/errors/502.html b/templates/errors/502.html new file mode 100644 index 00000000..8c10db54 --- /dev/null +++ b/templates/errors/502.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block content %} + +
+

That action isn't allowed

+
+ + +{% endblock %} + +{% block scripts %} +{% endblock %}