diff --git a/packages/dapp-svelte-wallet/api/src/lib-wallet.js b/packages/dapp-svelte-wallet/api/src/lib-wallet.js index 64640fb8e93..db7e22be656 100644 --- a/packages/dapp-svelte-wallet/api/src/lib-wallet.js +++ b/packages/dapp-svelte-wallet/api/src/lib-wallet.js @@ -928,6 +928,9 @@ export async function makeWallet({ .catch(rejected); } catch (e) { console.error('Have error', e); + if (offer.actions) { + E(offer.actions).error(offer, e); + } rejected(e); throw e; } diff --git a/packages/dapp-svelte-wallet/api/src/wallet.js b/packages/dapp-svelte-wallet/api/src/wallet.js index 813935f225e..c2b648ae48e 100644 --- a/packages/dapp-svelte-wallet/api/src/wallet.js +++ b/packages/dapp-svelte-wallet/api/src/wallet.js @@ -117,6 +117,19 @@ export function buildRootObject(_vatPowers) { [meta.channelHandle], ); }, + error(offer, reason) { + httpSend( + { + type: 'walletOfferResult', + data: { + id: offer.id, + dappContext: offer.dappContext, + error: `${(reason && reason.stack) || reason}`, + }, + }, + [meta.channelHandle], + ); + }, handled(offer) { if (handled) { return;