Be more informative when unable to JSON serialize

This commit is contained in:
Aarni Koskela
2014-08-03 13:24:12 +02:00
committed by Honza Král
parent 3932c32516
commit 00b6212212
+1 -1
View File
@@ -28,7 +28,7 @@ class JSONSerializer(object):
return data.isoformat()
elif isinstance(data, Decimal):
return float(data)
raise TypeError
raise TypeError("Unable to serialize %r (type: %s)" % (data, type(data)))
def loads(self, s):
try: