Commits

Matthew Schinckel  committed 5ee71fd

Trim exception handling.

  • Participants
  • Parent commits 60ded7b

Comments (0)

Files changed (1)

File jsonfield/forms.py

         if isinstance(value, six.string_types) and value:
             try:
                 return json.loads(value)
-            except Exception as exc:
+            except ValueError as exc:
                 raise forms.ValidationError(
-                    'JSON decode error: %s' % (six.u(exc),)
+                    'JSON decode error: %s' % (six.u(exc.args[0]),)
                 )
         else:
             return value