mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-19 00:49:49 +00:00
fix #3508
This commit is contained in:
parent
42ed4bc3d6
commit
ac2d4eb0ef
3 changed files with 22 additions and 4 deletions
|
@ -234,6 +234,15 @@ class BaseWizard(object):
|
||||||
self.plugin = self.plugins.get_plugin(name)
|
self.plugin = self.plugins.get_plugin(name)
|
||||||
try:
|
try:
|
||||||
self.plugin.setup_device(device_info, self, purpose)
|
self.plugin.setup_device(device_info, self, purpose)
|
||||||
|
except OSError as e:
|
||||||
|
self.show_error(_('We encountered an error while connecting to your device:')
|
||||||
|
+ '\n' + str(e) + '\n'
|
||||||
|
+ _('To try to fix this, we will now re-pair with your device.') + '\n'
|
||||||
|
+ _('Please try again.'))
|
||||||
|
devmgr = self.plugins.device_manager
|
||||||
|
devmgr.unpair_id(device_info.device.id_)
|
||||||
|
self.choose_hw_device(purpose)
|
||||||
|
return
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.show_error(str(e))
|
self.show_error(str(e))
|
||||||
self.choose_hw_device(purpose)
|
self.choose_hw_device(purpose)
|
||||||
|
|
|
@ -362,15 +362,20 @@ class DeviceMgr(ThreadJob, PrintError):
|
||||||
if not xpub in self.xpub_ids:
|
if not xpub in self.xpub_ids:
|
||||||
return
|
return
|
||||||
_id = self.xpub_ids.pop(xpub)
|
_id = self.xpub_ids.pop(xpub)
|
||||||
client = self.client_lookup(_id)
|
self._close_client(_id)
|
||||||
self.clients.pop(client, None)
|
|
||||||
if client:
|
|
||||||
client.close()
|
|
||||||
|
|
||||||
def unpair_id(self, id_):
|
def unpair_id(self, id_):
|
||||||
xpub = self.xpub_by_id(id_)
|
xpub = self.xpub_by_id(id_)
|
||||||
if xpub:
|
if xpub:
|
||||||
self.unpair_xpub(xpub)
|
self.unpair_xpub(xpub)
|
||||||
|
else:
|
||||||
|
self._close_client(id_)
|
||||||
|
|
||||||
|
def _close_client(self, id_):
|
||||||
|
client = self.client_lookup(id_)
|
||||||
|
self.clients.pop(client, None)
|
||||||
|
if client:
|
||||||
|
client.close()
|
||||||
|
|
||||||
def pair_xpub(self, xpub, id_):
|
def pair_xpub(self, xpub, id_):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
|
|
|
@ -172,6 +172,10 @@ class Ledger_Client():
|
||||||
raise Exception("Dongle is temporarily locked - please unplug it and replug it again")
|
raise Exception("Dongle is temporarily locked - please unplug it and replug it again")
|
||||||
if ((e.sw & 0xFFF0) == 0x63c0):
|
if ((e.sw & 0xFFF0) == 0x63c0):
|
||||||
raise Exception("Invalid PIN - please unplug the dongle and plug it again before retrying")
|
raise Exception("Invalid PIN - please unplug the dongle and plug it again before retrying")
|
||||||
|
if e.sw == 0x6f00 and e.message == 'Invalid channel':
|
||||||
|
# based on docs 0x6f00 might be a more general error, hence we also compare message to be sure
|
||||||
|
raise Exception("Invalid channel.\n"
|
||||||
|
"Please make sure that 'Browser support' is disabled on your device.")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
def checkDevice(self):
|
def checkDevice(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue