mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
exception formatting: use repr(e) instead of str(e) in messages
repr(e) is more useful
This commit is contained in:
parent
44a2ceab3c
commit
d77e4d8f5d
6 changed files with 7 additions and 7 deletions
|
@ -239,7 +239,7 @@ class BaseWizard(object):
|
||||||
try:
|
try:
|
||||||
scanned_devices = devmgr.scan_devices()
|
scanned_devices = devmgr.scan_devices()
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
devmgr.print_error('error scanning devices: {}'.format(e))
|
devmgr.print_error('error scanning devices: {}'.format(repr(e)))
|
||||||
debug_msg = ' {}:\n {}'.format(_('Error scanning devices'), e)
|
debug_msg = ' {}:\n {}'.format(_('Error scanning devices'), e)
|
||||||
else:
|
else:
|
||||||
debug_msg = ''
|
debug_msg = ''
|
||||||
|
|
|
@ -133,7 +133,7 @@ class ElectrumGui(PrintError):
|
||||||
self.app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
|
self.app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
use_dark_theme = False
|
use_dark_theme = False
|
||||||
self.print_error('Error setting dark theme: {}'.format(e))
|
self.print_error('Error setting dark theme: {}'.format(repr(e)))
|
||||||
# Even if we ourselves don't set the dark theme,
|
# Even if we ourselves don't set the dark theme,
|
||||||
# the OS/window manager/etc might set *a dark theme*.
|
# the OS/window manager/etc might set *a dark theme*.
|
||||||
# Hence, try to choose colors accordingly:
|
# Hence, try to choose colors accordingly:
|
||||||
|
|
|
@ -2409,7 +2409,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
try:
|
try:
|
||||||
data = bh2u(bitcoin.base_decode(data, length=None, base=43))
|
data = bh2u(bitcoin.base_decode(data, length=None, base=43))
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.show_error((_('Could not decode QR code')+':\n{}').format(e))
|
self.show_error((_('Could not decode QR code')+':\n{}').format(repr(e)))
|
||||||
return
|
return
|
||||||
tx = self.tx_from_text(data)
|
tx = self.tx_from_text(data)
|
||||||
if not tx:
|
if not tx:
|
||||||
|
|
|
@ -267,7 +267,7 @@ class Interface(PrintError):
|
||||||
try:
|
try:
|
||||||
return await func(self, *args, **kwargs)
|
return await func(self, *args, **kwargs)
|
||||||
except GracefulDisconnect as e:
|
except GracefulDisconnect as e:
|
||||||
self.print_error("disconnecting gracefully. {}".format(e))
|
self.print_error("disconnecting gracefully. {}".format(repr(e)))
|
||||||
finally:
|
finally:
|
||||||
await self.network.connection_down(self)
|
await self.network.connection_down(self)
|
||||||
self.got_disconnected.set_result(1)
|
self.got_disconnected.set_result(1)
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Processor(threading.Thread, PrintError):
|
||||||
self.M = imaplib.IMAP4_SSL(self.imap_server)
|
self.M = imaplib.IMAP4_SSL(self.imap_server)
|
||||||
self.M.login(self.username, self.password)
|
self.M.login(self.username, self.password)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.print_error('connecting failed: {}'.format(e))
|
self.print_error('connecting failed: {}'.format(repr(e)))
|
||||||
self.connect_wait *= 2
|
self.connect_wait *= 2
|
||||||
else:
|
else:
|
||||||
self.reset_connect_wait()
|
self.reset_connect_wait()
|
||||||
|
@ -100,7 +100,7 @@ class Processor(threading.Thread, PrintError):
|
||||||
try:
|
try:
|
||||||
self.poll()
|
self.poll()
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.print_error('polling failed: {}'.format(e))
|
self.print_error('polling failed: {}'.format(repr(e)))
|
||||||
break
|
break
|
||||||
time.sleep(self.polling_interval)
|
time.sleep(self.polling_interval)
|
||||||
time.sleep(random.randint(0, self.connect_wait))
|
time.sleep(random.randint(0, self.connect_wait))
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -72,7 +72,7 @@ class CustomInstallCommand(install):
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
subprocess.call(["pyrcc5", "icons.qrc", "-o", path])
|
subprocess.call(["pyrcc5", "icons.qrc", "-o", path])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Warning: building icons file failed with {}'.format(e))
|
print('Warning: building icons file failed with {}'.format(repr(e)))
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|
Loading…
Add table
Reference in a new issue