synchronous_get: return -> raise exception

This commit is contained in:
ThomasV 2015-08-07 12:22:47 +02:00
parent 85d9b8aa8d
commit c844d22a19
2 changed files with 8 additions and 8 deletions

View File

@ -2272,13 +2272,13 @@ class ElectrumWindow(QMainWindow):
from electrum import transaction
txid, ok = QInputDialog.getText(self, _('Lookup transaction'), _('Transaction ID') + ':')
if ok and txid:
r = self.network.synchronous_get([ ('blockchain.transaction.get',[str(txid)]) ])[0]
if r:
tx = transaction.Transaction(r)
if tx:
self.show_transaction(tx)
else:
self.show_message("unknown transaction")
try:
r = self.network.synchronous_get([('blockchain.transaction.get',[str(txid)])])[0]
except BaseException as e:
self.show_message(str(e))
return
tx = transaction.Transaction(r)
self.show_transaction(tx)
@protected

View File

@ -170,7 +170,7 @@ class NetworkProxy(util.DaemonThread):
_id = r.get('id')
ids.remove(_id)
if r.get('error'):
return BaseException(r.get('error'))
raise BaseException(r.get('error'))
result = r.get('result')
res[_id] = r.get('result')
out = []