From 1b2ff38aff6b92376c0ac485a7544f6dd7f43770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Thu, 3 Jul 2025 15:54:41 +0200 Subject: [PATCH] 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. --- src/pydase/utils/serialization/serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pydase/utils/serialization/serializer.py b/src/pydase/utils/serialization/serializer.py index 046c6c5..4685c06 100644 --- a/src/pydase/utils/serialization/serializer.py +++ b/src/pydase/utils/serialization/serializer.py @@ -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__, }