Exception handling is missing request information, won't work with Sentry

Issue #45 resolved
Martin Saizar created an issue

The application handles exceptions on its own, it should leave this to Django. When an exception is raised, emailing works but it is missing request information (Request repr(): unavailable). Sentry won't work because it doesn't catch these exceptions. The Django framework passes the request info to the logger via the extra parameter:

logger.error(
        'Internal Server Error: %s', request.path,
        exc_info=exc_info,
        extra={'status_code': 500, 'request': request},
    )

Handling exceptions like this fixes the email with "Request repr(): unavailable" bug, but it won't fix the Sentry bug. My suggestion is to remove exception handling code from django-datatables-view, and let Django handle them. Then the frontend Datatables code should handle 500 errors accordingly.

Comments (1)

  1. Log in to comment