Skip to content

Commit

Permalink
v0.5.2 catch listener errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Dec 8, 2024
1 parent 03c8789 commit 16f1635
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="teslemetry_stream",
version="0.5.1",
version="0.5.2",
author="Brett Adams",
author_email="hello@teslemetry.com",
description="Teslemetry Streaming API library for Python",
Expand Down
5 changes: 4 additions & 1 deletion teslemetry_stream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ async def listen(self):
if event:
for listener, filters in self._listeners.values():
if recursive_match(filters, event):
listener(event)
try:
listener(event)
except Exception as error:
LOGGER.error("Uncaught error in listener: %s", error)
LOGGER.debug("Listen has finished")

def recursive_match(dict1, dict2):
Expand Down

0 comments on commit 16f1635

Please sign in to comment.