diff --git a/src/main.js b/src/main.js index 89b417d..ed0125f 100644 --- a/src/main.js +++ b/src/main.js @@ -476,11 +476,13 @@ async function showErrorDialog(options) { }) if (opts.type === 'dang') { - console.error('showErrorDialog', opts.msg) + console.error('showErrorDialog', opts) } else { console.log('showErrorDialog', opts) } + let outputMsg = opts.msg?.response || opts.msg?.stack || opts.msg + await appDialogs.confirmAction?.render({ name: opts.title, actionTxt: 'Report Issue', @@ -503,10 +505,10 @@ async function showErrorDialog(options) { ${state.header(state)}
- + +
${outputMsg}
${state.footer(state)} @@ -636,7 +638,7 @@ async function main() { mainApp, appDialogs, appState, appTools, store, userInfo, contactsList, walletFunds, setupDialog, deriveWalletData, getAddrsWithFunds, - sendTx, updateAllFunds, + sendTx, updateAllFunds, showErrorDialog, }) appDialogs.requestQr = await requestQrRig({ diff --git a/src/rigs/send-confirm.js b/src/rigs/send-confirm.js index 1a1cc5a..6170979 100644 --- a/src/rigs/send-confirm.js +++ b/src/rigs/send-confirm.js @@ -11,7 +11,7 @@ export let sendConfirmRig = (async function (globals) { let { mainApp, setupDialog, appDialogs, appState, appTools, - sendTx, store, userInfo, contactsList, + sendTx, store, userInfo, contactsList, showErrorDialog, } = globals let sendConfirm = await setupDialog( @@ -150,9 +150,18 @@ export let sendConfirmRig = (async function (globals) { } if (state.tx) { - txRes = await sendTx( - state.tx, - ) + try { + txRes = await sendTx( + state.tx, + ) + } catch(err) { + return await showErrorDialog({ + type: 'dang', + title: 'Failed to send transaction', + msg: err, + showActBtn: false, + }) + } } if (txRes && addressIndex !== undefined) {