-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
heartbeat_thread of HeartbeatListener, need to handle network error #40
Comments
Sorry, but don't understand the difference. Slight change to the error message doesn't make much difference in my opinion. |
It looks like he wants a handler for "Exception" in addition to the handler for "NotConnectedException". I personally try to stay away from blanket catching of "Exception", since that will catch programming errors in addition to runtime errors, but that seems like the request. |
Ah. The bold bits kind-of caught me out. Pretty obvious now you point it out. Agreed in general, regarding catching Exception, but in this case it's the heartbeat loop. Not 100% sure on reflection. Don't like the idea of swallowing that sort of error, but not sure not-catching is the right answer either. Will give it some further thought... |
Resolved in version 4.1.6 |
Code:
try:
self.transport.transmit(utils.Frame(None, {}, None))
except exception.NotConnectedException:
logger.Log.instance().debug("Lost connection, unable to send heartbeat")
need to fix as:
try:
self.transport.transmit(utils.Frame(None, {}, None))
except exception.NotConnectedException:
logger.Log.instance().debug("Lost connection, unable to send heartbeat")
excep Exception:
logger.Log.instance().debug("Error sending heartbeat frame")
The text was updated successfully, but these errors were encountered: