From 5056da6548d5880211abd3e1cdacd92134e40dab Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 1 Sep 2020 18:00:46 +0530 Subject: test error handling --- packages/taler-wallet-core/src/types/pending.ts | 7 +++++++ .../taler-wallet-core/src/types/transactions.ts | 21 ++------------------- packages/taler-wallet-core/src/types/walletTypes.ts | 3 +-- 3 files changed, 10 insertions(+), 21 deletions(-) (limited to 'packages/taler-wallet-core/src/types') diff --git a/packages/taler-wallet-core/src/types/pending.ts b/packages/taler-wallet-core/src/types/pending.ts index 85f7585c5..67d243a37 100644 --- a/packages/taler-wallet-core/src/types/pending.ts +++ b/packages/taler-wallet-core/src/types/pending.ts @@ -210,6 +210,7 @@ export interface PendingWithdrawOperation { type: PendingOperationType.Withdraw; source: WithdrawalSource; lastError: OperationErrorDetails | undefined; + retryInfo: RetryInfo; withdrawalGroupId: string; numCoinsWithdrawn: number; numCoinsTotal: number; @@ -229,6 +230,12 @@ export interface PendingOperationInfoCommon { * as opposed to some regular scheduled operation or a permanent failure. */ givesLifeness: boolean; + + /** + * Retry info, not available on all pending operations. + * If it is available, it must have the same name. + */ + retryInfo?: RetryInfo; } /** diff --git a/packages/taler-wallet-core/src/types/transactions.ts b/packages/taler-wallet-core/src/types/transactions.ts index 061ce28f4..400439548 100644 --- a/packages/taler-wallet-core/src/types/transactions.ts +++ b/packages/taler-wallet-core/src/types/transactions.ts @@ -42,6 +42,7 @@ import { codecForList, codecForAny, } from "../util/codec"; +import { OperationErrorDetails } from "./walletTypes"; export interface TransactionsRequest { /** @@ -63,24 +64,6 @@ export interface TransactionsResponse { transactions: Transaction[]; } -export interface TransactionError { - /** - * TALER_EC_* unique error code. - * The action(s) offered and message displayed on the transaction item depend on this code. - */ - ec: number; - - /** - * English-only error hint, if available. - */ - hint?: string; - - /** - * Error details specific to "ec", if applicable/available - */ - details?: any; -} - export interface TransactionCommon { // opaque unique ID for the transaction, used as a starting point for paginating queries // and for invoking actions on the transaction (e.g. deleting/hiding it from the history) @@ -103,7 +86,7 @@ export interface TransactionCommon { // Amount added or removed from the wallet's balance (including all fees and other costs) amountEffective: AmountString; - error?: TransactionError; + error?: OperationErrorDetails; } export type Transaction = diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index 2cf3c7fbc..eb7d878fa 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -51,7 +51,6 @@ import { buildCodecForUnion, } from "../util/codec"; import { AmountString, codecForContractTerms, ContractTerms } from "./talerTypes"; -import { TransactionError, OrderShortInfo, codecForOrderShortInfo } from "./transactions"; /** * Response for the create reserve request to the wallet. @@ -215,7 +214,7 @@ export interface ConfirmPayResultDone { export interface ConfirmPayResultPending { type: ConfirmPayResultType.Pending; - lastError: TransactionError; + lastError: OperationErrorDetails; } export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending; -- cgit v1.2.3