summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Unterwaditzer <markus@unterwaditzer.net>2019-05-30 20:52:16 +0200
committerGitHub <noreply@github.com>2019-05-30 20:52:16 +0200
commit8e7de70c5f099600480e08bdc708041dc581929e (patch)
treed61836b033a4d8f349064a878dab213de8fbde66
parentd173bb5894a0e940aacf922ba71f67d89eb9084a (diff)
downloadraven-8e7de70c5f099600480e08bdc708041dc581929e.tar.gz
fix: Do not catch all exceptions when dumping json (#1352)
-rw-r--r--raven/utils/json.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/raven/utils/json.py b/raven/utils/json.py
index ef8fe25..d1de66d 100644
--- a/raven/utils/json.py
+++ b/raven/utils/json.py
@@ -15,6 +15,7 @@ import uuid
import json
from .basic import is_namedtuple
+from .compat import PY2
try:
@@ -56,11 +57,10 @@ def better_decoder(data):
def dumps(value, **kwargs):
- try:
- return json.dumps(value, cls=BetterJSONEncoder, **kwargs)
- except Exception:
+ if PY2:
kwargs['encoding'] = 'safe-utf-8'
- return json.dumps(value, cls=BetterJSONEncoder, **kwargs)
+
+ return json.dumps(value, cls=BetterJSONEncoder, **kwargs)
def loads(value, **kwargs):