Browse Source

qml: show pay_invoice error to user

master
Sander van Grieken 3 years ago
parent
commit
04c9078955
  1. 6
      electrum/gui/qml/components/WalletMainView.qml
  2. 3
      electrum/gui/qml/qewallet.py

6
electrum/gui/qml/components/WalletMainView.qml

@ -306,6 +306,12 @@ Item {
}) })
dialog.open() dialog.open()
} }
function onPaymentFailed(invoice_id, message) {
var dialog = app.messageDialog.createObject(app, {
text: message
})
dialog.open()
}
} }
Component { Component {

3
electrum/gui/qml/qewallet.py

@ -609,7 +609,8 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
fut = asyncio.run_coroutine_threadsafe(coro, get_asyncio_loop()) fut = asyncio.run_coroutine_threadsafe(coro, get_asyncio_loop())
fut.result() fut.result()
except Exception as e: except Exception as e:
self.paymentFailed.emit(invoice.get_id(), repr(e)) self._logger.error(f'pay_invoice failed! {e!r}')
self.paymentFailed.emit(invoice.get_id(), str(e))
threading.Thread(target=pay_thread, daemon=True).start() threading.Thread(target=pay_thread, daemon=True).start()

Loading…
Cancel
Save