mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 07:23:25 +00:00
qt sweep: raise more specific exception so that trace is not logged
When raising generic Exception, window.on_error can't tell whether there was a programming error or we just want to communicate with the user. E | gui.qt.main_window.[default_wallet] | on_error Traceback (most recent call last): File "/home/user/wspace/electrum/electrum/gui/qt/util.py", line 832, in run result = task.task() File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 2900, in <lambda> task = lambda: self.network.run_from_another_thread( File "/home/user/wspace/electrum/electrum/network.py", line 358, in run_from_another_thread return fut.result(timeout) File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result return self.__get_result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception File "/home/user/wspace/electrum/electrum/wallet.py", line 162, in sweep_preparations raise Exception(_('No inputs found.')) Exception: No inputs found.
This commit is contained in:
parent
13dca30428
commit
a97cb88a1a
1 changed files with 2 additions and 2 deletions
|
@ -78,7 +78,7 @@ from .mnemonic import Mnemonic
|
||||||
from .logging import get_logger
|
from .logging import get_logger
|
||||||
from .lnworker import LNWallet, LNBackups
|
from .lnworker import LNWallet, LNBackups
|
||||||
from .paymentrequest import PaymentRequest
|
from .paymentrequest import PaymentRequest
|
||||||
from .util import read_json_file, write_json_file
|
from .util import read_json_file, write_json_file, UserFacingException
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .network import Network
|
from .network import Network
|
||||||
|
@ -159,7 +159,7 @@ async def sweep_preparations(privkeys, network: 'Network', imax=100):
|
||||||
# we also search for pay-to-pubkey outputs
|
# we also search for pay-to-pubkey outputs
|
||||||
await group.spawn(find_utxos_for_privkey('p2pk', privkey, compressed))
|
await group.spawn(find_utxos_for_privkey('p2pk', privkey, compressed))
|
||||||
if not inputs:
|
if not inputs:
|
||||||
raise Exception(_('No inputs found.'))
|
raise UserFacingException(_('No inputs found.'))
|
||||||
return inputs, keypairs
|
return inputs, keypairs
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue