We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2808f73 commit 95e6bfeCopy full SHA for 95e6bfe
json_field/forms.py
@@ -21,10 +21,10 @@ def clean(self, value):
21
}
22
try:
23
value = json.dumps(eval(value, json_globals, {}), **self.encoder_kwargs)
24
- except Exception: # eval can throw many different errors
25
- raise util.ValidationError(self.help_text) # throw the original error?
+ except Exception, e: # eval can throw many different errors
+ raise util.ValidationError('%s (Caught "%s")' % (self.help_text, e))
26
27
json.loads(value, **self.decoder_kwargs)
28
- except ValueError:
29
- raise util.ValidationError(self.help_text)
+ except ValueError, e:
30
return value
0 commit comments