Skip to content

Commit

Permalink
len of emitted message
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Aug 1, 2023
1 parent e22caf0 commit 78ff317
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ovos_bus_client/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,17 @@ def emit(self, message: Message):
'before emitting messages')
self.connected_event.wait()

if hasattr(message, 'serialize'):
msg = message.serialize()
else:
msg = json.dumps(message.__dict__)
try:
if hasattr(message, 'serialize'):
msg = message.serialize()
else:
msg = json.dumps(message.__dict__)
self.client.send(msg)
except WebSocketConnectionClosedException:
LOG.warning(f'Could not send {message.msg_type} message because connection '
'has been closed')
except Exception as e:
LOG.exception(f"failed to emit message {message.msg_type}")
LOG.exception(f"failed to emit message {message.msg_type} with len {len(msg)}")

def collect_responses(self, message: Message,
min_timeout: Union[int, float] = 0.2,
Expand Down

0 comments on commit 78ff317

Please sign in to comment.