0002-jsonresponse-fix-exception-logging-for-exception-con.patch
passerelle/utils/jsonresponse.py | ||
---|---|---|
126 | 126 |
extras.update({'body': req.body}) |
127 | 127 |
if (not isinstance(e, (Http404, PermissionDenied, ObjectDoesNotExist)) |
128 | 128 |
and getattr(e, 'log_error', True)): |
129 |
logger.exception("Error occurred while processing request", extra=extras) |
|
129 |
logger.exception(u"Error occurred while processing request", extra=extras)
|
|
130 | 130 |
elif isinstance(e, ObjectDoesNotExist): |
131 | 131 |
logger.warning('object not found: %r', e, extra=extras) |
132 | 132 |
elif isinstance(e, PermissionDenied): |
tests/test_dummy.py | ||
---|---|---|
19 | 19 |
resource_pk=conn.pk) |
20 | 20 |
return conn |
21 | 21 | |
22 |
@pytest.mark.xfail |
|
23 | 22 |
def test_exception_with_utf8(app, dummy, mailoutbox, caplog): |
24 | 23 |
app.get('/dummy/dummy/exception_with_utf8/', status=500) |
25 | 24 |
assert u'Exception: é' in mailoutbox[0].body |
26 |
- |