Beispiel #1
0
    def process_ledger_exceptions_int(*args, **kwargs):
        hwDevice = args[0]
        try:
            return func(*args, **kwargs)

        except BTChipException as e:
            printDbg('Error while communicating with Ledger hardware wallet.')
            e.message = 'Error while communicating with Ledger hardware wallet.'
            if (e.sw in (0x6f01, 0x6d00, 0x6700, 0x6faa)):
                e.message = 'Make sure the PIVX app is open on your Ledger device.'
                e.message += '<br>If there is a program (such as Ledger Bitcoin Wallet) interfering with the USB communication, close it first.'
            elif (e.sw == 0x6982):
                e.message = 'Enter the PIN on your Ledger device.'
            printException(getCallerName(True), getFunctionName(True), e.message, e.args)
            raise DisconnectedException(e.message, hwDevice)

        except Exception as e:
            e.message = "Ledger - generic exception"
            if str(e.args[0]) == 'read error':
                e.message = 'Read Error. Click "Connect" to reconnect HW device'
            printException(getCallerName(True), getFunctionName(True), e.message, str(e))
            raise DisconnectedException(e.message, hwDevice)
Beispiel #2
0
 def process_trezor_exceptions_int(*args, **kwargs):
     hwDevice = args[0]
     try:
         return func(*args, **kwargs)
     except exceptions.Cancelled:
         printDbg("Action cancelled on the device")
         return
     except exceptions.PinException:
         hwDevice.status = 4
         printOK("WRONG PIN")
         return
     except Exception as e:
         err_mess = "Trezor Exception"
         printException(getCallerName(True), getFunctionName(True), err_mess, str(e))
         raise DisconnectedException(str(e), hwDevice)