From 148e27c8daa5bc2c2cc2493bae8ae28d07c16c6b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 15 Oct 2011 11:51:43 -0400 Subject: [PATCH] 500 handler --- httpbin/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/httpbin/core.py b/httpbin/core.py index 80ac50c..d1261fc 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -34,6 +34,10 @@ app = Flask(__name__) # Routes # ------ +@app.errorhandler(500) +@filters.json +def page_not_found(e): + return {'error': True, 'why': str(e)} @app.route('/') def view_landing_page():