[IMP] JSONDecodeError > ValueError
JSONDecodeError extends ValueError, and is not available in the Python Standard Library.
This commit is contained in:
committed by
Martin Trigaux
parent
60af7cac02
commit
bf4b47c94d
+2
-2
@@ -504,8 +504,8 @@ class JsonRequest(WebRequest):
|
||||
|
||||
# Read POST content or POST Form Data named "request"
|
||||
try:
|
||||
self.jsonrequest = simplejson.loads(request)
|
||||
except simplejson.JSONDecodeError:
|
||||
self.jsonrequest = json.loads(request)
|
||||
except ValueError:
|
||||
msg = 'Invalid JSON data: %r' % (request,)
|
||||
_logger.info('%s: %s', self.httprequest.path, msg)
|
||||
raise werkzeug.exceptions.BadRequest(msg)
|
||||
|
||||
Reference in New Issue
Block a user