summaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-09-29 00:23:30 +0200
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-09-29 00:23:30 +0200
commitc3ee743c756d7da7a1fab40584575fed642858a8 (patch)
tree3f7221231ba9501710e1e830ddf92c882117084e /app.py
parent220941cad39f1d0e5d75c219e62ec11d9ec0799b (diff)
downloadweb-c3ee743c756d7da7a1fab40584575fed642858a8.tar.gz
web-c3ee743c756d7da7a1fab40584575fed642858a8.tar.bz2
web-c3ee743c756d7da7a1fab40584575fed642858a8.zip
use errorhandler for HTTP status error codes
with this we can use our base layout to display pretty error messages
Diffstat (limited to 'app.py')
-rw-r--r--app.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/app.py b/app.py
index 3227540..595311b 100644
--- a/app.py
+++ b/app.py
@@ -267,6 +267,14 @@ def logout():
def about():
return {}
+@app.errorhandler(403)
+def forbidden(e):
+ return render_template('error.html', error=e), 403
+
+@app.errorhandler(404)
+def page_not_found(e):
+ return render_template('error.html', error=e), 404
+
@app.route('/debug')
def debug():