Skip to content

Commit

Permalink
Update error handling to prevent trying to emit an error when the cli…
Browse files Browse the repository at this point in the history
…ent is disconnected
  • Loading branch information
NeonDaniel committed May 21, 2024
1 parent 93363fb commit 4c06daf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ovos_bus_client/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ def on_error(self, *args):
LOG.warning('Could not send message because connection has closed')
elif isinstance(error, ConnectionRefusedError):
LOG.warning('Connection Refused. Is Messagebus Service running?')
elif isinstance(error, ConnectionResetError):
LOG.warning('Connection Reset. Did the Messagebus Service stop?')
else:
LOG.exception('=== %s ===', repr(error))
self.emitter.emit('error', error)

try:
self.emitter.emit('error', error)
if self.client.keep_running:
self.client.close()
except Exception as e:
Expand Down

0 comments on commit 4c06daf

Please sign in to comment.