Commit c329ab95 authored by Julien Muchembled's avatar Julien Muchembled

neoctl: better error message when connection to admin fails

parent 8b07ff98
......@@ -506,7 +506,10 @@ class Connection(BaseConnection):
def setReconnectionNoDelay(self):
return self.connector.setReconnectionNoDelay
return self.connector.setReconnectionNoDelay
except AttributeError:
raise ConnectionClosed
def close(self):
if self.connector is None:
......@@ -15,7 +15,7 @@
# along with this program. If not, see <>.
from import BaseApplication
from neo.lib.connection import ClientConnection
from neo.lib.connection import ClientConnection, ConnectionClosed
from neo.lib.protocol import ClusterStates, NodeStates, ErrorCodes, Packets
from .handler import CommandEventHandler
......@@ -38,11 +38,14 @@ class NeoCTL(BaseApplication):
self.connection = ClientConnection(self, self.handler, self.server)
# Never delay reconnection to master. This speeds up unit tests
# and it should not change anything for normal use.
except ConnectionClosed:
self.connection = None
while not self.connected:
if self.connection is None:
raise NotReadyException('not connected')
return self.connection
def __ask(self, packet):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment