Skip to content

Commit

Permalink
fix: don't raise error if header is not 4 but warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne de Montalivet committed Dec 7, 2023
1 parent f11762c commit 12c62ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions micromed_io/in_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def decode_data_header_packet(self, packet: bytearray) -> None:
self.micromed_header.nb_of_bytes = int.from_bytes(packet[148:150], "little")
self.micromed_header.header_type = int.from_bytes(packet[175:176], "little")

# Check micromed header type (must be 4)
# Check micromed header type
if self.micromed_header.header_type != 4:
raise ValueError(
f"Error: Header is not 4 but {self.micromed_header.header_type}. "
+ "Parsing is inappropriate."
logging.warning(
f"Header type is not 4 but {self.micromed_header.header_type}. "
+ "Parsing might be inappropriate."
)

# get zones position and length
Expand Down

0 comments on commit 12c62ca

Please sign in to comment.