Skip to content

Commit

Permalink
handle all exceptions on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshannan committed Feb 24, 2019
1 parent ac5b0dd commit 4df24db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nats/io/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def connect(self,
self._status = Client.CONNECTING
yield self._process_connect_init()
break
except (socket.error, tornado.iostream.StreamClosedError) as e:
except Exception as e:
self._status = Client.DISCONNECTED
self._err = e
if self._error_cb is not None:
Expand Down Expand Up @@ -1127,7 +1127,7 @@ def _attempt_reconnect(self):
self._status = Client.DISCONNECTED
yield self.close()
break
except (socket.error, NatsError, tornado.iostream.StreamClosedError) as e:
except Exception as e:
self._err = e
if self._error_cb is not None:
self._error_cb(e)
Expand Down Expand Up @@ -1203,7 +1203,7 @@ def _select_next_server(self):
yield self._server_connect(s)
self._current_server = s
break
except (socket.error, tornado.iostream.StreamClosedError) as e:
except Exception as e:
s.last_attempt = time.time()
s.reconnects += 1

Expand Down

0 comments on commit 4df24db

Please sign in to comment.