diff --git a/wallets/lib/protocols/nwc.js b/wallets/lib/protocols/nwc.js index 12a2a72f..9e4a3561 100644 --- a/wallets/lib/protocols/nwc.js +++ b/wallets/lib/protocols/nwc.js @@ -45,7 +45,9 @@ export async function nwcTryRun (fun, { url }, { signal }) { const nostr = new Nostr() try { const nwc = await getNwc(nostr, url, { signal }) - return await fun(nwc) + const res = await fun(nwc) + if (res.error) throw new Error(res.error) + return res } catch (e) { if (e.error) throw new Error(e.error.message || e.error.code) throw e