Browse Source

Log user-facing exceptions in app log.

pull/24/head
Ben Kurtovic 9 years ago
parent
commit
8321a22f05
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      app.fcgi

+ 2
- 0
app.fcgi View File

@@ -35,8 +35,10 @@ def catch_errors(func):
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)
except TemplateError as exc: except TemplateError as exc:
app.logger.error(u"Caught exception:\n{0}".format(exc.text))
return render_template("error.mako", traceback=exc.text) return render_template("error.mako", traceback=exc.text)
except Exception: except Exception:
app.logger.exception(u"Caught exception:")
return render_template("error.mako", traceback=format_exc()) return render_template("error.mako", traceback=format_exc())
return inner return inner




Loading…
Cancel
Save