Be more informative when unable to JSON serialize
This commit is contained in:
committed by
Honza Král
parent
3932c32516
commit
00b6212212
@@ -28,7 +28,7 @@ class JSONSerializer(object):
|
|||||||
return data.isoformat()
|
return data.isoformat()
|
||||||
elif isinstance(data, Decimal):
|
elif isinstance(data, Decimal):
|
||||||
return float(data)
|
return float(data)
|
||||||
raise TypeError
|
raise TypeError("Unable to serialize %r (type: %s)" % (data, type(data)))
|
||||||
|
|
||||||
def loads(self, s):
|
def loads(self, s):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user