Fix/exception verbose output only (#91)

* made the print statement of when unpacking a message fails controlled by the verbose flag

* bump to 0.5.3
This commit is contained in:
Aljoscha Sander
2024-02-27 19:10:38 +08:00
committed by GitHub
parent 1ab1cbf521
commit e2c2d01de6
3 changed files with 6 additions and 5 deletions

View File

@@ -16,4 +16,4 @@ __all__ = [
"AsyncSink",
"AsyncSource",
]
__version__ = "0.5.2"
__version__ = "0.5.3"

View File

@@ -103,10 +103,11 @@ class AsyncUdpSource(AsyncSource):
data = await self.queue.get()
try:
payload = self.unpacker(data.decode(self.config.encoding, errors="ignore"))
except UnicodeDecodeError:
print(f"Could not decode data, is not {self.config.encoding}")
# except UnicodeDecodeError: # this won't be thrown anymore, as the error flag is set to ignore!
# print(f"Could not decode data, is not {self.config.encoding}")
except Exception:
print(f"Could not deserialize data: {data!r}")
if self.config.verbose:
print(f"Could not deserialize data: {data!r}")
else:
return (self.topic, payload)

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "heisskleber"
version = "0.5.2"
version = "0.5.3"
description = "Heisskleber"
authors = ["Felix Weiler <felix@flucto.tech>"]
license = "MIT"