1
0

qml: show pay_invoice error to user

This commit is contained in:
Sander van Grieken
2023-05-15 11:56:40 +02:00
parent 3115ce2f53
commit 04c9078955
2 changed files with 8 additions and 1 deletions

View File

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

View File

@@ -609,7 +609,8 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
fut = asyncio.run_coroutine_threadsafe(coro, get_asyncio_loop())
fut.result()
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()