add InvalidPassword exception
This commit is contained in:
@@ -24,7 +24,7 @@ import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk, Gdk, GObject, cairo
|
||||
from decimal import Decimal
|
||||
from electrum.util import print_error
|
||||
from electrum.util import print_error, InvalidPassword
|
||||
from electrum.bitcoin import is_valid
|
||||
from electrum import WalletStorage, Wallet
|
||||
|
||||
@@ -596,7 +596,7 @@ class ElectrumWindow:
|
||||
|
||||
try:
|
||||
wallet.get_seed(password)
|
||||
except Exception:
|
||||
except InvalidPassword:
|
||||
show_message("Incorrect password")
|
||||
return
|
||||
|
||||
|
||||
@@ -1912,8 +1912,8 @@ class ElectrumWindow(QMainWindow):
|
||||
|
||||
try:
|
||||
mnemonic = self.wallet.get_mnemonic(password)
|
||||
except Exception:
|
||||
QMessageBox.warning(self, _('Error'), _('Incorrect Password'), _('OK'))
|
||||
except BaseException as e:
|
||||
QMessageBox.warning(self, _('Error'), str(e), _('OK'))
|
||||
return
|
||||
from seed_dialog import SeedDialog
|
||||
d = SeedDialog(self, mnemonic, self.wallet.has_imported_keys())
|
||||
@@ -2312,10 +2312,10 @@ class ElectrumWindow(QMainWindow):
|
||||
|
||||
try:
|
||||
mnemonic = self.wallet.get_mnemonic(password)
|
||||
except Exception:
|
||||
QMessageBox.warning(self, _('Error'), _('Incorrect Password'), _('OK'))
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self, _('Error'), str(e), _('OK'))
|
||||
return
|
||||
|
||||
|
||||
d = QDialog(self)
|
||||
d.setWindowTitle(_('Private keys'))
|
||||
d.setMinimumSize(850, 300)
|
||||
|
||||
@@ -157,8 +157,8 @@ class PasswordDialog(QDialog):
|
||||
|
||||
try:
|
||||
self.wallet.check_password(password)
|
||||
except Exception:
|
||||
QMessageBox.warning(self.parent, _('Error'), _('Incorrect Password'), _('OK'))
|
||||
except BaseException as e:
|
||||
QMessageBox.warning(self.parent, _('Error'), str(e), _('OK'))
|
||||
return False, None, None
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user