diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-29 00:23:30 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-29 00:23:30 +0200 |
commit | c3ee743c756d7da7a1fab40584575fed642858a8 (patch) | |
tree | 3f7221231ba9501710e1e830ddf92c882117084e /app.py | |
parent | 220941cad39f1d0e5d75c219e62ec11d9ec0799b (diff) | |
download | web-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.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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(): |