Skip to content
Snippets Groups Projects
Commit 6aece882 authored by DAVID Pierre's avatar DAVID Pierre
Browse files

Add proper message/exit in case of a connection error

parent 501d2948
Branches
Tags
No related merge requests found
Pipeline #347415 passed with stages
in 1 minute and 2 seconds
......@@ -253,7 +253,12 @@ def connected_as(data):
printv('connecting to '+API_URL+'...')
printv('login user '+os.environ['QCM_USER_NAME']+'...')
sio.connect(API_URL, transports=['websocket'], namespaces=['/'], wait_timeout = 20)
try:
sio.connect(API_URL, transports=['websocket'], namespaces=['/'], wait_timeout = 20)
except socketio.exceptions.ConnectionError as e:
print('Cannot connect to {}\n{}'.format(API_URL, e), file=sys.stderr)
exit(1)
sio.emit('verify', os.environ['QCM_USER_NAME']+':'+os.environ['QCM_USER_TOKEN'])
sio.wait()
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