Skip to content

Commit

Permalink
added logging of failed decode data
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Kaats committed Jan 30, 2025
1 parent 1c5a70a commit 8c29aaf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dsmr_parser/clients/serial_.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def read(self):
try:
decoded_data = data.decode('ascii')
except:
pass
logger.warning('Failed to decode telegram data: %s', data)
else:
self.telegram_buffer.append(decoded_data)

Expand All @@ -59,7 +59,7 @@ def read_as_object(self):
try:
decoded_data = data.decode('ascii')
except:
pass
logger.warning('Failed to decode telegram data: %s', data)
else:
self.telegram_buffer.append(decoded_data)

Expand Down Expand Up @@ -98,7 +98,7 @@ async def read(self, queue):
try:
decoded_data = data.decode('ascii')
except:
pass
logger.warning('Failed to decode telegram data: %s', data)
else:
self.telegram_buffer.append(decoded_data)

Expand Down Expand Up @@ -134,7 +134,7 @@ async def read_as_object(self, queue):
try:
decoded_data = data.decode('ascii')
except:
pass
logger.warning('Failed to decode telegram data: %s', data)
else:
self.telegram_buffer.append(decoded_data)

Expand Down

0 comments on commit 8c29aaf

Please sign in to comment.