Skip to content
Permalink
Browse files

error handling for connection manager

  • Loading branch information
slinger360 committed Jan 13, 2020
1 parent 50c4e40 commit 69aaf2975fc8d839b5755f88f926c1b6283a9d60
Showing with 8 additions and 3 deletions.
  1. +8 −3 nbclient.py
@@ -62,7 +62,14 @@ def connect(self):
# (namely droidble) requiring some initalization in main thread...
self._connect_inner(link)
time.sleep(3)

if self.link == 'ble':
if self._link.device:
self.update_state('connected')
elif self.link == 'tcp':
if self._link.connected:
self.update_state('connected')
else:
self.update_state('connected')
elif link == None:
tprint('select interface and protocol first')
self.update_state('disconnected')
@@ -75,8 +82,6 @@ def connect(self):
self.dispatch('on_error', repr(exc))
raise exc

if link != None:
self.update_state('connected')

@specialthread
def _connect_inner(self, link):

0 comments on commit 69aaf29

Please sign in to comment.
You can’t perform that action at this time.