1
0

do not raise BaseException

This commit is contained in:
SomberNight
2018-04-07 17:10:30 +02:00
parent 76e67daadd
commit 7b50790584
21 changed files with 53 additions and 53 deletions

View File

@@ -107,7 +107,7 @@ class DigitalBitbox_Client():
xpub = serialize_xpub(xtype, c, cK, depth, fingerprint, child_number)
return xpub
else:
raise BaseException('no reply')
raise Exception('no reply')
def dbb_has_password(self):

View File

@@ -344,7 +344,7 @@ class KeepKeyCompatiblePlugin(HW_PluginBase):
elif addrtype == constants.net.ADDRTYPE_P2SH:
txoutputtype.script_type = self.types.PAYTOSCRIPTHASH
else:
raise BaseException('addrtype: ' + str(addrtype))
raise Exception('addrtype: ' + str(addrtype))
txoutputtype.address = address
return txoutputtype

View File

@@ -72,10 +72,10 @@ class LabelsPlugin(BasePlugin):
kwargs['headers']['Content-Type'] = 'application/json'
response = requests.request(method, url, **kwargs)
if response.status_code != 200:
raise BaseException(response.status_code, response.text)
raise Exception(response.status_code, response.text)
response = response.json()
if "error" in response:
raise BaseException(response["error"])
raise Exception(response["error"])
return response
def do_request_safe(self, *args, **kwargs):

View File

@@ -188,7 +188,7 @@ class Ledger_Client():
self.perform_hw1_preflight()
except BTChipException as e:
if (e.sw == 0x6d00 or e.sw == 0x6700):
raise BaseException(_("Device not in Bitcoin mode")) from e
raise Exception(_("Device not in Bitcoin mode")) from e
raise e
self.preflightDone = True

View File

@@ -406,7 +406,7 @@ class TrustedCoinPlugin(BasePlugin):
xprv1, xpub1 = self.get_xkeys(seed, passphrase, "m/0'/")
xprv2, xpub2 = self.get_xkeys(seed, passphrase, "m/1'/")
else:
raise BaseException('unrecognized seed length: {} words'.format(n))
raise Exception('unrecognized seed length: {} words'.format(n))
return xprv1, xpub1, xprv2, xpub2
def create_keystore(self, wizard, seed, passphrase):