Merge lp://staging/~michael.nelson/rnr-server/remove-old-exception-middleware into lp://staging/rnr-server

Proposed by Michael Nelson
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
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/michael/code/rnr/virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/michael/code/rnr/src/reviewsapp/decorators.py", line 63, in wrapper
    result = view(*args, **kwargs)
  File "/home/michael/code/rnr/src/reviewsapp/views/__init__.py", line 43, in overview
    status=ReviewModeration.PENDING_STATUS).count()
  File "/home/michael/code/rnr/virtualenv/local/lib/python2.7/site-packages/mock.py", line 955, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/home/michael/code/rnr/virtualenv/local/lib/python2.7/site-packages/mock.py", line 1010, in _mock_call
    raise effect
ZeroDivisionError: This error is made up.
2014-01-03 15:51:45,147 - root - ERROR - Exception details in OOPS-9b4896b068704cd7a384e66ecaa91149

}}}

To post a comment you must log in.
Revision history for this message
Michael Foord (mfoord) wrote :

Great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches