fixing ValueError and better logging for determine_value try catch

This commit is contained in:
echoDaveD
2025-02-12 17:36:48 +01:00
parent 01e80e3cb3
commit 97e83d2bea
2 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ class MessageProcessor:
try:
msgvalue = self.determine_value(msg.packet_payload, msgname)
except Exception as e:
raise MessageWarningException(argument=msg['payload'], message=f"Value of {hexmsg:<6} couldn't be determinate, skip Message {e}")
raise MessageWarningException(argument=msg.packet_payload, message=f"Value of {hexmsg} couldn't be determinate, skip Message {e}")
self.protocolMessage(msg, msgname, msgvalue)
else:
logger.debug(f"Message not Found in NASA repository: {hexmsg:<6} Type: {msg.packet_message_type} Payload: {msg.packet_payload}")

View File

@@ -259,9 +259,9 @@ class NASAPacket:
elif message_type == 3:
payload_size = len(msg_rest)
if capacity != 1:
raise ValueError(message="Message with structure type must have capacity of 1.")
raise ValueError("Message with structure type must have capacity of 1.")
else:
raise ValueError(message=f"Mssage type unknown: {message_type}")
raise ValueError(f"Mssage type unknown: {message_type}")
payload = msg_rest[2:2 + payload_size]
if len(payload) > 255: