diff options
author | Florian Dold <florian@dold.me> | 2023-06-20 11:40:06 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-20 11:40:06 +0200 |
commit | 9c708251f92e6691ebba80fa8d129c6c04cec618 (patch) | |
tree | edf46c7b3f9386697a4ea697c2d66f66323a6d3e /packages/taler-wallet-core/src/operations/pay-merchant.ts | |
parent | 54f0c82999833132baf83995526025ac56d6fe06 (diff) |
wallet-core: emit DD37 self-transition notifications with errors
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-merchant.ts | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts index c3f288ff7..ad6552f06 100644 --- a/packages/taler-wallet-core/src/operations/pay-merchant.ts +++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts @@ -67,7 +67,6 @@ import { TalerErrorCode, TalerErrorDetail, TalerPreciseTimestamp, - TalerProtocolTimestamp, TalerProtocolViolationError, TalerUriAction, TransactionAction, @@ -116,12 +115,11 @@ import { OperationAttemptResult, OperationAttemptResultType, RetryInfo, - scheduleRetry, TaskIdentifiers, -} from "../util/retries.js"; +} from "./common.js"; import { runLongpollAsync, - runOperationWithErrorReporting, + runTaskWithErrorReporting, spendCoins, } from "./common.js"; import { @@ -1254,7 +1252,7 @@ export async function runPayForConfirmPay( tag: PendingTaskType.Purchase, proposalId, }); - const res = await runOperationWithErrorReporting(ws, taskId, async () => { + const res = await runTaskWithErrorReporting(ws, taskId, async () => { return await processPurchasePay(ws, proposalId, { forceNow: true }); }); logger.trace(`processPurchasePay response type ${res.type}`); @@ -1618,18 +1616,11 @@ export async function processPurchasePay( // Do this in the background, as it might take some time handleInsufficientFunds(ws, proposalId, err).catch(async (e) => { console.log("handling insufficient funds failed"); - - await scheduleRetry(ws, TaskIdentifiers.forPay(purchase), { - code: TalerErrorCode.WALLET_UNEXPECTED_EXCEPTION, - when: AbsoluteTime.now(), - message: "unexpected exception", - hint: "unexpected exception", - details: { - exception: e.toString(), - }, - }); + console.log(`${e.toString()}`); }); + // FIXME: Should we really consider this to be pending? + return { type: OperationAttemptResultType.Pending, result: undefined, @@ -1694,11 +1685,6 @@ export async function processPurchasePay( await unblockBackup(ws, proposalId); } - ws.notify({ - type: NotificationType.PayOperationSuccess, - proposalId: purchase.proposalId, - }); - return OperationAttemptResult.finishedEmpty(); } |