diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 3282fef40..35e88385f 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2018,9 +2018,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): try: tx = tx_from_str(txt) return Transaction(tx) - except: - traceback.print_exc(file=sys.stdout) - self.show_critical(_("Electrum was unable to parse your transaction")) + except BaseException as e: + self.show_critical(_("Electrum was unable to parse your transaction") + ":\n" + str(e)) return def read_tx_from_qrcode(self): diff --git a/lib/transaction.py b/lib/transaction.py index 0e4b6e0cb..16d701f44 100644 --- a/lib/transaction.py +++ b/lib/transaction.py @@ -896,6 +896,8 @@ def tx_from_str(txt): "json or raw hexadecimal" import json txt = txt.strip() + if not txt: + raise ValueError("empty string") try: bfh(txt) is_hex = True