1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-28 07:12:28 +00:00

chore(core): improve error message

[no changelog]
This commit is contained in:
Ioan Bizău 2025-01-21 09:55:56 +01:00
parent 31f2eb06dc
commit ec397fedd3

View File

@ -62,7 +62,9 @@ class ProtobufMapping:
"""
wire_type = self.class_to_type_override.get(type(msg), msg.MESSAGE_WIRE_TYPE)
if wire_type is None:
raise ValueError("Cannot encode class without wire type")
raise ValueError(
f'Cannot encode class "{type(msg).__name__}" without wire type'
)
buf = io.BytesIO()
protobuf.dump_message(buf, msg)