aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/views')
-rw-r--r--pysite/views/main/error_handlers/http_5xx.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pysite/views/main/error_handlers/http_5xx.py b/pysite/views/main/error_handlers/http_5xx.py
new file mode 100644
index 00000000..ed4d8d82
--- /dev/null
+++ b/pysite/views/main/error_handlers/http_5xx.py
@@ -0,0 +1,12 @@
+# coding=utf-8
+from werkzeug.exceptions import HTTPException
+
+from pysite.base_route import ErrorView
+
+
+class Error404View(ErrorView):
+ name = "error_5xx"
+ error_code = range(500, 600)
+
+ def get(self, error: HTTPException):
+ return "Internal server error. Please try again later!", error.code