Merge lp://staging/~michael.nelson/rnr-server/remove-old-exception-middleware into lp://staging/rnr-server
Status: | Merged |
---|---|
Approved by: | Michael Nelson |
Approved revision: | 241 |
Merged at revision: | 240 |
Proposed branch: | lp://staging/~michael.nelson/rnr-server/remove-old-exception-middleware |
Merge into: | lp://staging/rnr-server |
Diff against target: |
318 lines (+5/-230) 5 files modified
django_project/config_dev/config/main.cfg (+0/-1) src/reviewsapp/middleware/exception.py (+0/-112) src/reviewsapp/tests/test_middleware.py (+0/-104) src/reviewsapp/tests/test_wsgi.py (+3/-13) src/reviewsapp/views/moderation.py (+2/-0) |
To merge this branch: | bzr merge lp://staging/~michael.nelson/rnr-server/remove-old-exception-middleware |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Foord (community) | Approve | ||
Review via email: mp+200408@code.staging.launchpad.net |
Commit message
Remove custom exception middleware and rely on oops instead.
Description of the change
Remove some middleware which was created to do essentially what we should be relying on oops for - logging diagnostic info on error - except it does it by temporarily switching to debug=True (I'm assuming that's not thread-safe) and prints out an html debug page into the log, which just leads to unreadable logs.
Instead, on error, a small message is logged in the app log with the oops id, after django's own logging adds the traceback, like this:
{{{
2014-01-03 15:51:45,141 - django.request - ERROR - Internal Server Error: /reviews/
Traceback (most recent call last):
File "/home/
response = callback(request, *callback_args, **callback_kwargs)
File "/home/
result = view(*args, **kwargs)
File "/home/
status=
File "/home/
return _mock_self.
File "/home/
raise effect
ZeroDivisionError: This error is made up.
2014-01-03 15:51:45,147 - root - ERROR - Exception details in OOPS-9b4896b068704cd7a384e66ecaa91149
}}}
Great!