From c539d1803c1376cba0831be64866b6d2c1652403 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 23 Mar 2022 13:11:36 +0100 Subject: wallet: address crypto worker hang and warning about worker termination --- packages/taler-wallet-core/src/errors.ts | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'packages/taler-wallet-core/src/errors.ts') diff --git a/packages/taler-wallet-core/src/errors.ts b/packages/taler-wallet-core/src/errors.ts index 07a01a760..eda5444bf 100644 --- a/packages/taler-wallet-core/src/errors.ts +++ b/packages/taler-wallet-core/src/errors.ts @@ -161,32 +161,3 @@ export function getErrorDetailFromException(e: any): TalerErrorDetail { ); return err; } - -/** - * Run an operation and call the onOpError callback - * when there was an exception or operation error that must be reported. - * The cause will be re-thrown to the caller. - */ -export async function guardOperationException( - op: () => Promise, - onOpError: (e: TalerErrorDetail) => Promise, -): Promise { - try { - return await op(); - } catch (e: any) { - if ( - e instanceof TalerError && - e.hasErrorCode(TalerErrorCode.WALLET_PENDING_OPERATION_FAILED) - ) { - throw e; - } - const opErr = getErrorDetailFromException(e); - await onOpError(opErr); - throw TalerError.fromDetail( - TalerErrorCode.WALLET_PENDING_OPERATION_FAILED, - { - innerError: e.errorDetail, - }, - ); - } -} -- cgit v1.2.3