Better logging

This commit is contained in:
Tony Garnock-Jones 2018-11-21 11:10:45 +00:00
parent e6cdf8127f
commit 56fc179834
1 changed files with 4 additions and 4 deletions

View File

@ -168,8 +168,8 @@ class TcpConnection(Connection, asyncio.Protocol):
lambda: self,
self.host,
self.port)
except OSError:
log.error('Could not connect to broker', exc_info=True)
except OSError as e:
log.error('TcpConnection: Could not connect to broker: %s' % (e,))
return False
try:
@ -212,8 +212,8 @@ class WebsocketConnection(Connection):
self._on_event(protocol.Decoder(chunk).next())
except websockets.exceptions.ConnectionClosed:
pass
except OSError:
log.error('Could not connect to broker', exc_info=True)
except OSError as e:
log.error('WebsocketConnection: Could not connect to broker: %s' % (e,))
return False
finally:
self._on_disconnected()