fix: serializing exception that didn't take an argument

An exception that was instantiated without any argument could not be
serilaized before. Now, I check if any args were supplied and set the
value to an empty string if no args were passed.
This commit is contained in:
Mose Müller
2025-07-03 15:54:41 +02:00
parent 4b243985e8
commit 1b2ff38aff

View File

@@ -158,7 +158,7 @@ class Serializer:
"doc": None,
"readonly": True,
"type": "Exception",
"value": obj.args[0],
"value": obj.args[0] if len(obj.args) > 0 else "",
"name": obj.__class__.__name__,
}