mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Metadata API: Add messages to serialization errors
We can't really add any details but this at least means printing the error works. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
This commit is contained in:
parent
03d023219b
commit
d4814e86d8
1 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ def deserialize(self, raw_data: bytes) -> Metadata:
|
|||
metadata_obj = Metadata.from_dict(json_dict)
|
||||
|
||||
except Exception as e:
|
||||
raise DeserializationError from e
|
||||
raise DeserializationError("Failed to deserialize JSON") from e
|
||||
|
||||
return metadata_obj
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ def serialize(self, metadata_obj: Metadata) -> bytes:
|
|||
).encode("utf-8")
|
||||
|
||||
except Exception as e:
|
||||
raise SerializationError from e
|
||||
raise SerializationError("Failed to serialize JSON") from e
|
||||
|
||||
return json_bytes
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue