I was using the TembaObject.deserialize() method to deserialize archived Run objects in my project (https://github.com/JustFixNYC/tenants2/pull/902) and noticed that an unusual exception was occurring. It's easily reproducible in the REPL:
>>> from temba_client.serialization import TembaSerializationException
>>>
>>> raise TembaSerializationException('boop')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
temba_client.exceptions.TembaSerializationException: <exception str() failed>
The actual cause of str() failing can be found via:
>>> str(TembaSerializationException('boop'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/venv/lib/python3.8/site-packages/temba_client/exceptions.py", line 3, in __str__
return self.message
AttributeError: 'TembaSerializationException' object has no attribute 'message'
So it looks like .message isn't being set in the constructor for TembaSerializationException? For now I'm just catching the exceptions and logging their args[0] attribute, but fixing these so they have meaningful error messages would be helpful.
Hello,
I was using the
TembaObject.deserialize()
method to deserialize archivedRun
objects in my project (https://github.com/JustFixNYC/tenants2/pull/902) and noticed that an unusual exception was occurring. It's easily reproducible in the REPL:The actual cause of
str()
failing can be found via:So it looks like
.message
isn't being set in the constructor forTembaSerializationException
? For now I'm just catching the exceptions and logging theirargs[0]
attribute, but fixing these so they have meaningful error messages would be helpful.