svenstaro/flamejam — Issue #39: Error handling is busted
Author: svenstaro
Created: 2011-11-08 22:11:34+00:00
State: open
Labels: bug

I get this for basically every other request:

[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] mod_wsgi (pid=12773): Exception occurred processing WSGI script '/var/flask-sites/flamejam/flamejam.wsgi'.
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] Traceback (most recent call last):
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] File "/var/flask-sites/flamejam/env/lib/python2.7/site-packages/flask/app.py", line 1518, in __call__
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] return self.wsgi_app(environ, start_response)
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] File "/var/flask-sites/flamejam/env/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] response = self.make_response(self.handle_exception(e))
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] File "/var/flask-sites/flamejam/env/lib/python2.7/site-packages/flask/app.py", line 1197, in handle_exception
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] return handler(e)
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] File "/var/flask-sites/flamejam/flamejam/views.py", line 712, in error
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] return render_template("error.html", error = error), error.code
[Tue Nov 08 23:04:32 2011] [error] [client 31.18.56.157] AttributeError: 'exceptions.TypeError' object has no attribute 'code'

Sucks. We should handle this way more properly. See http://flask.pocoo.org/docs/errorhandling/#application-errors and http://flask.pocoo.org/docs/patterns/errorpages/