Skip to content

Commit

Permalink
fix: handling of None messages from notify callback
Browse files Browse the repository at this point in the history
This is especially common as BaseMessageBus._finalize calls handler(None, err)
when an exception is raised.
  • Loading branch information
Remy Noel committed Sep 4, 2023
1 parent 119b27b commit 3b4813a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dbus_fast/message_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ def add_match_notify(msg, err):
logging.error(
f'add match request failed. match="{self._name_owner_match_rule}", {err}'
)
if msg.message_type == MessageType.ERROR:
elif msg.message_type == MessageType.ERROR:
logging.error(
f'add match request failed. match="{self._name_owner_match_rule}", {msg.body[0]}'
)
Expand Down Expand Up @@ -1228,7 +1228,7 @@ def _add_match_rule(self, match_rule):
def add_match_notify(msg: Message, err: Optional[Exception]) -> None:
if err:
logging.error(f'add match request failed. match="{match_rule}", {err}')
if msg.message_type == MessageType.ERROR:
elif msg.message_type == MessageType.ERROR:
logging.error(
f'add match request failed. match="{match_rule}", {msg.body[0]}'
)
Expand Down Expand Up @@ -1267,7 +1267,7 @@ def remove_match_notify(msg, err):
logging.error(
f'remove match request failed. match="{match_rule}", {err}'
)
if msg.message_type == MessageType.ERROR:
elif msg.message_type == MessageType.ERROR:
logging.error(
f'remove match request failed. match="{match_rule}", {msg.body[0]}'
)
Expand Down

0 comments on commit 3b4813a

Please sign in to comment.