harmonized error codes

This commit is contained in:
Florian Dold 2020-09-01 18:27:22 +05:30
parent 5056da6548
commit 8c33e05bf0
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
14 changed files with 71 additions and 71 deletions

View File

@ -23,7 +23,7 @@
/** /**
* Imports. * Imports.
*/ */
import { OperationErrorDetails } from "../types/walletTypes"; import { TalerErrorDetails } from "../types/walletTypes";
import { TalerErrorCode } from "../TalerErrorCode"; import { TalerErrorCode } from "../TalerErrorCode";
/** /**
@ -31,7 +31,7 @@ import { TalerErrorCode } from "../TalerErrorCode";
* but the error has already been reported by writing it to the database. * but the error has already been reported by writing it to the database.
*/ */
export class OperationFailedAndReportedError extends Error { export class OperationFailedAndReportedError extends Error {
constructor(public operationError: OperationErrorDetails) { constructor(public operationError: TalerErrorDetails) {
super(operationError.message); super(operationError.message);
// Set the prototype explicitly. // Set the prototype explicitly.
@ -52,7 +52,7 @@ export class OperationFailedError extends Error {
return new OperationFailedError(makeErrorDetails(ec, message, details)); return new OperationFailedError(makeErrorDetails(ec, message, details));
} }
constructor(public operationError: OperationErrorDetails) { constructor(public operationError: TalerErrorDetails) {
super(operationError.message); super(operationError.message);
// Set the prototype explicitly. // Set the prototype explicitly.
@ -64,7 +64,7 @@ export function makeErrorDetails(
ec: TalerErrorCode, ec: TalerErrorCode,
message: string, message: string,
details: Record<string, unknown>, details: Record<string, unknown>,
): OperationErrorDetails { ): TalerErrorDetails {
return { return {
code: ec, code: ec,
hint: `Error: ${TalerErrorCode[ec]}`, hint: `Error: ${TalerErrorCode[ec]}`,
@ -80,7 +80,7 @@ export function makeErrorDetails(
*/ */
export async function guardOperationException<T>( export async function guardOperationException<T>(
op: () => Promise<T>, op: () => Promise<T>,
onOpError: (e: OperationErrorDetails) => Promise<void>, onOpError: (e: TalerErrorDetails) => Promise<void>,
): Promise<T> { ): Promise<T> {
try { try {
return await op(); return await op();

View File

@ -20,7 +20,7 @@ import {
codecForExchangeKeysJson, codecForExchangeKeysJson,
codecForExchangeWireJson, codecForExchangeWireJson,
} from "../types/talerTypes"; } from "../types/talerTypes";
import { OperationErrorDetails } from "../types/walletTypes"; import { TalerErrorDetails } from "../types/walletTypes";
import { import {
ExchangeRecord, ExchangeRecord,
ExchangeUpdateStatus, ExchangeUpdateStatus,
@ -86,7 +86,7 @@ async function denominationRecordFromKeys(
async function setExchangeError( async function setExchangeError(
ws: InternalWalletState, ws: InternalWalletState,
baseUrl: string, baseUrl: string,
err: OperationErrorDetails, err: TalerErrorDetails,
): Promise<void> { ): Promise<void> {
logger.warn(`last error for exchange ${baseUrl}:`, err); logger.warn(`last error for exchange ${baseUrl}:`, err);
const mut = (exchange: ExchangeRecord): ExchangeRecord => { const mut = (exchange: ExchangeRecord): ExchangeRecord => {
@ -438,7 +438,7 @@ export async function updateExchangeFromUrl(
baseUrl: string, baseUrl: string,
forceNow = false, forceNow = false,
): Promise<ExchangeRecord> { ): Promise<ExchangeRecord> {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
setExchangeError(ws, baseUrl, e); setExchangeError(ws, baseUrl, e);
return await guardOperationException( return await guardOperationException(
() => updateExchangeFromUrlImpl(ws, baseUrl, forceNow), () => updateExchangeFromUrlImpl(ws, baseUrl, forceNow),

View File

@ -46,7 +46,7 @@ import {
} from "../types/talerTypes"; } from "../types/talerTypes";
import { import {
ConfirmPayResult, ConfirmPayResult,
OperationErrorDetails, TalerErrorDetails,
PreparePayResult, PreparePayResult,
RefreshReason, RefreshReason,
PreparePayResultType, PreparePayResultType,
@ -516,7 +516,7 @@ async function recordConfirmPay(
async function incrementProposalRetry( async function incrementProposalRetry(
ws: InternalWalletState, ws: InternalWalletState,
proposalId: string, proposalId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.proposals], async (tx) => { await ws.db.runWithWriteTransaction([Stores.proposals], async (tx) => {
const pr = await tx.get(Stores.proposals, proposalId); const pr = await tx.get(Stores.proposals, proposalId);
@ -539,7 +539,7 @@ async function incrementProposalRetry(
async function incrementPurchasePayRetry( async function incrementPurchasePayRetry(
ws: InternalWalletState, ws: InternalWalletState,
proposalId: string, proposalId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
logger.warn("incrementing purchase pay retry with error", err); logger.warn("incrementing purchase pay retry with error", err);
await ws.db.runWithWriteTransaction([Stores.purchases], async (tx) => { await ws.db.runWithWriteTransaction([Stores.purchases], async (tx) => {
@ -565,7 +565,7 @@ export async function processDownloadProposal(
proposalId: string, proposalId: string,
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
const onOpErr = (err: OperationErrorDetails): Promise<void> => const onOpErr = (err: TalerErrorDetails): Promise<void> =>
incrementProposalRetry(ws, proposalId, err); incrementProposalRetry(ws, proposalId, err);
await guardOperationException( await guardOperationException(
() => processDownloadProposalImpl(ws, proposalId, forceNow), () => processDownloadProposalImpl(ws, proposalId, forceNow),
@ -1205,7 +1205,7 @@ export async function processPurchasePay(
proposalId: string, proposalId: string,
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementPurchasePayRetry(ws, proposalId, e); incrementPurchasePayRetry(ws, proposalId, e);
await guardOperationException( await guardOperationException(
() => processPurchasePayImpl(ws, proposalId, forceNow), () => processPurchasePayImpl(ws, proposalId, forceNow),

View File

@ -44,7 +44,7 @@ import { forceQueryReserve, getReserveRequestTimeout } from "./reserves";
import { Amounts } from "../util/amounts"; import { Amounts } from "../util/amounts";
import { createRefreshGroup, processRefreshGroup } from "./refresh"; import { createRefreshGroup, processRefreshGroup } from "./refresh";
import { RefreshReason, OperationErrorDetails } from "../types/walletTypes"; import { RefreshReason, TalerErrorDetails } from "../types/walletTypes";
import { TransactionHandle } from "../util/query"; import { TransactionHandle } from "../util/query";
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto"; import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
import { getTimestampNow } from "../util/time"; import { getTimestampNow } from "../util/time";
@ -58,7 +58,7 @@ const logger = new Logger("operations/recoup.ts");
async function incrementRecoupRetry( async function incrementRecoupRetry(
ws: InternalWalletState, ws: InternalWalletState,
recoupGroupId: string, recoupGroupId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.recoupGroups], async (tx) => { await ws.db.runWithWriteTransaction([Stores.recoupGroups], async (tx) => {
const r = await tx.get(Stores.recoupGroups, recoupGroupId); const r = await tx.get(Stores.recoupGroups, recoupGroupId);
@ -305,7 +305,7 @@ export async function processRecoupGroup(
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
await ws.memoProcessRecoup.memo(recoupGroupId, async () => { await ws.memoProcessRecoup.memo(recoupGroupId, async () => {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementRecoupRetry(ws, recoupGroupId, e); incrementRecoupRetry(ws, recoupGroupId, e);
return await guardOperationException( return await guardOperationException(
async () => await processRecoupGroupImpl(ws, recoupGroupId, forceNow), async () => await processRecoupGroupImpl(ws, recoupGroupId, forceNow),

View File

@ -34,7 +34,7 @@ import { Logger } from "../util/logging";
import { getWithdrawDenomList } from "./withdraw"; import { getWithdrawDenomList } from "./withdraw";
import { updateExchangeFromUrl } from "./exchanges"; import { updateExchangeFromUrl } from "./exchanges";
import { import {
OperationErrorDetails, TalerErrorDetails,
CoinPublicKey, CoinPublicKey,
RefreshReason, RefreshReason,
RefreshGroupId, RefreshGroupId,
@ -441,7 +441,7 @@ async function refreshReveal(
async function incrementRefreshRetry( async function incrementRefreshRetry(
ws: InternalWalletState, ws: InternalWalletState,
refreshGroupId: string, refreshGroupId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.refreshGroups], async (tx) => { await ws.db.runWithWriteTransaction([Stores.refreshGroups], async (tx) => {
const r = await tx.get(Stores.refreshGroups, refreshGroupId); const r = await tx.get(Stores.refreshGroups, refreshGroupId);
@ -470,7 +470,7 @@ export async function processRefreshGroup(
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
await ws.memoProcessRefresh.memo(refreshGroupId, async () => { await ws.memoProcessRefresh.memo(refreshGroupId, async () => {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementRefreshRetry(ws, refreshGroupId, e); incrementRefreshRetry(ws, refreshGroupId, e);
return await guardOperationException( return await guardOperationException(
async () => await processRefreshGroupImpl(ws, refreshGroupId, forceNow), async () => await processRefreshGroupImpl(ws, refreshGroupId, forceNow),

View File

@ -25,7 +25,7 @@
*/ */
import { InternalWalletState } from "./state"; import { InternalWalletState } from "./state";
import { import {
OperationErrorDetails, TalerErrorDetails,
RefreshReason, RefreshReason,
CoinPublicKey, CoinPublicKey,
} from "../types/walletTypes"; } from "../types/walletTypes";
@ -65,7 +65,7 @@ const logger = new Logger("refund.ts");
async function incrementPurchaseQueryRefundRetry( async function incrementPurchaseQueryRefundRetry(
ws: InternalWalletState, ws: InternalWalletState,
proposalId: string, proposalId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.purchases], async (tx) => { await ws.db.runWithWriteTransaction([Stores.purchases], async (tx) => {
const pr = await tx.get(Stores.purchases, proposalId); const pr = await tx.get(Stores.purchases, proposalId);
@ -438,7 +438,7 @@ export async function processPurchaseQueryRefund(
proposalId: string, proposalId: string,
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementPurchaseQueryRefundRetry(ws, proposalId, e); incrementPurchaseQueryRefundRetry(ws, proposalId, e);
await guardOperationException( await guardOperationException(
() => processPurchaseQueryRefundImpl(ws, proposalId, forceNow), () => processPurchaseQueryRefundImpl(ws, proposalId, forceNow),

View File

@ -17,7 +17,7 @@
import { import {
CreateReserveRequest, CreateReserveRequest,
CreateReserveResponse, CreateReserveResponse,
OperationErrorDetails, TalerErrorDetails,
AcceptWithdrawalResponse, AcceptWithdrawalResponse,
} from "../types/walletTypes"; } from "../types/walletTypes";
import { canonicalizeBaseUrl } from "../util/helpers"; import { canonicalizeBaseUrl } from "../util/helpers";
@ -311,7 +311,7 @@ export async function processReserve(
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
return ws.memoProcessReserve.memo(reservePub, async () => { return ws.memoProcessReserve.memo(reservePub, async () => {
const onOpError = (err: OperationErrorDetails): Promise<void> => const onOpError = (err: TalerErrorDetails): Promise<void> =>
incrementReserveRetry(ws, reservePub, err); incrementReserveRetry(ws, reservePub, err);
await guardOperationException( await guardOperationException(
() => processReserveImpl(ws, reservePub, forceNow), () => processReserveImpl(ws, reservePub, forceNow),
@ -375,7 +375,7 @@ async function processReserveBankStatus(
ws: InternalWalletState, ws: InternalWalletState,
reservePub: string, reservePub: string,
): Promise<void> { ): Promise<void> {
const onOpError = (err: OperationErrorDetails): Promise<void> => const onOpError = (err: TalerErrorDetails): Promise<void> =>
incrementReserveRetry(ws, reservePub, err); incrementReserveRetry(ws, reservePub, err);
await guardOperationException( await guardOperationException(
() => processReserveBankStatusImpl(ws, reservePub), () => processReserveBankStatusImpl(ws, reservePub),
@ -480,7 +480,7 @@ async function processReserveBankStatusImpl(
async function incrementReserveRetry( async function incrementReserveRetry(
ws: InternalWalletState, ws: InternalWalletState,
reservePub: string, reservePub: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.reserves], async (tx) => { await ws.db.runWithWriteTransaction([Stores.reserves], async (tx) => {
const r = await tx.get(Stores.reserves, reservePub); const r = await tx.get(Stores.reserves, reservePub);

View File

@ -16,7 +16,7 @@
import { InternalWalletState } from "./state"; import { InternalWalletState } from "./state";
import { parseTipUri } from "../util/taleruri"; import { parseTipUri } from "../util/taleruri";
import { TipStatus, OperationErrorDetails } from "../types/walletTypes"; import { TipStatus, TalerErrorDetails } from "../types/walletTypes";
import { import {
TipPlanchetDetail, TipPlanchetDetail,
codecForTipPickupGetResponse, codecForTipPickupGetResponse,
@ -137,7 +137,7 @@ export async function getTipStatus(
async function incrementTipRetry( async function incrementTipRetry(
ws: InternalWalletState, ws: InternalWalletState,
refreshSessionId: string, refreshSessionId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.tips], async (tx) => { await ws.db.runWithWriteTransaction([Stores.tips], async (tx) => {
const t = await tx.get(Stores.tips, refreshSessionId); const t = await tx.get(Stores.tips, refreshSessionId);
@ -160,7 +160,7 @@ export async function processTip(
tipId: string, tipId: string,
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementTipRetry(ws, tipId, e); incrementTipRetry(ws, tipId, e);
await guardOperationException( await guardOperationException(
() => processTipImpl(ws, tipId, forceNow), () => processTipImpl(ws, tipId, forceNow),

View File

@ -32,7 +32,7 @@ import {
import { import {
BankWithdrawDetails, BankWithdrawDetails,
ExchangeWithdrawDetails, ExchangeWithdrawDetails,
OperationErrorDetails, TalerErrorDetails,
ExchangeListItem, ExchangeListItem,
} from "../types/walletTypes"; } from "../types/walletTypes";
import { import {
@ -552,7 +552,7 @@ export async function selectWithdrawalDenoms(
async function incrementWithdrawalRetry( async function incrementWithdrawalRetry(
ws: InternalWalletState, ws: InternalWalletState,
withdrawalGroupId: string, withdrawalGroupId: string,
err: OperationErrorDetails | undefined, err: TalerErrorDetails | undefined,
): Promise<void> { ): Promise<void> {
await ws.db.runWithWriteTransaction([Stores.withdrawalGroups], async (tx) => { await ws.db.runWithWriteTransaction([Stores.withdrawalGroups], async (tx) => {
const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId); const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId);
@ -574,7 +574,7 @@ export async function processWithdrawGroup(
withdrawalGroupId: string, withdrawalGroupId: string,
forceNow = false, forceNow = false,
): Promise<void> { ): Promise<void> {
const onOpErr = (e: OperationErrorDetails): Promise<void> => const onOpErr = (e: TalerErrorDetails): Promise<void> =>
incrementWithdrawalRetry(ws, withdrawalGroupId, e); incrementWithdrawalRetry(ws, withdrawalGroupId, e);
await guardOperationException( await guardOperationException(
() => processWithdrawGroupImpl(ws, withdrawalGroupId, forceNow), () => processWithdrawGroupImpl(ws, withdrawalGroupId, forceNow),
@ -645,7 +645,7 @@ async function processWithdrawGroupImpl(
let numFinished = 0; let numFinished = 0;
let finishedForFirstTime = false; let finishedForFirstTime = false;
let errorsPerCoin: Record<number, OperationErrorDetails> = {}; let errorsPerCoin: Record<number, TalerErrorDetails> = {};
await ws.db.runWithWriteTransaction( await ws.db.runWithWriteTransaction(
[Stores.coins, Stores.withdrawalGroups, Stores.reserves, Stores.planchets], [Stores.coins, Stores.withdrawalGroups, Stores.reserves, Stores.planchets],

View File

@ -35,7 +35,7 @@ import {
} from "./talerTypes"; } from "./talerTypes";
import { Index, Store } from "../util/query"; import { Index, Store } from "../util/query";
import { OperationErrorDetails, RefreshReason } from "./walletTypes"; import { TalerErrorDetails, RefreshReason } from "./walletTypes";
import { import {
ReserveTransaction, ReserveTransaction,
ReserveCreditTransaction, ReserveCreditTransaction,
@ -335,7 +335,7 @@ export interface ReserveRecord {
* Last error that happened in a reserve operation * Last error that happened in a reserve operation
* (either talking to the bank or the exchange). * (either talking to the bank or the exchange).
*/ */
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
/** /**
@ -649,7 +649,7 @@ export interface ExchangeRecord {
*/ */
updateDiff: ExchangeUpdateDiff | undefined; updateDiff: ExchangeUpdateDiff | undefined;
lastError?: OperationErrorDetails; lastError?: TalerErrorDetails;
} }
/** /**
@ -679,7 +679,7 @@ export interface PlanchetRecord {
withdrawalDone: boolean; withdrawalDone: boolean;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
/** /**
* Public key of the reserve, this might be a reserve not * Public key of the reserve, this might be a reserve not
@ -910,14 +910,14 @@ export interface ProposalRecord {
*/ */
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
/** /**
* Status of a tip we got from a merchant. * Status of a tip we got from a merchant.
*/ */
export interface TipRecord { export interface TipRecord {
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
/** /**
* Has the user accepted the tip? Only after the tip has been accepted coins * Has the user accepted the tip? Only after the tip has been accepted coins
@ -1002,9 +1002,9 @@ export interface RefreshGroupRecord {
*/ */
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
lastErrorPerCoin: { [coinIndex: number]: OperationErrorDetails }; lastErrorPerCoin: { [coinIndex: number]: TalerErrorDetails };
refreshGroupId: string; refreshGroupId: string;
@ -1032,7 +1032,7 @@ export interface RefreshGroupRecord {
* Ongoing refresh * Ongoing refresh
*/ */
export interface RefreshSessionRecord { export interface RefreshSessionRecord {
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
/** /**
* Public key that's being melted in this session. * Public key that's being melted in this session.
@ -1383,7 +1383,7 @@ export interface PurchaseRecord {
payRetryInfo: RetryInfo; payRetryInfo: RetryInfo;
lastPayError: OperationErrorDetails | undefined; lastPayError: TalerErrorDetails | undefined;
/** /**
* Retry information for querying the refund status with the merchant. * Retry information for querying the refund status with the merchant.
@ -1393,7 +1393,7 @@ export interface PurchaseRecord {
/** /**
* Last error (or undefined) for querying the refund status with the merchant. * Last error (or undefined) for querying the refund status with the merchant.
*/ */
lastRefundStatusError: OperationErrorDetails | undefined; lastRefundStatusError: TalerErrorDetails | undefined;
/** /**
* Continue querying the refund status until this deadline has expired. * Continue querying the refund status until this deadline has expired.
@ -1541,7 +1541,7 @@ export interface WithdrawalGroupRecord {
*/ */
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
export interface BankWithdrawUriRecord { export interface BankWithdrawUriRecord {
@ -1606,7 +1606,7 @@ export interface RecoupGroupRecord {
/** /**
* Last error that occured, if any. * Last error that occured, if any.
*/ */
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
export const enum ImportPayloadType { export const enum ImportPayloadType {

View File

@ -22,7 +22,7 @@
/** /**
* Imports. * Imports.
*/ */
import { OperationErrorDetails } from "./walletTypes"; import { TalerErrorDetails } from "./walletTypes";
import { WithdrawalSource } from "./dbTypes"; import { WithdrawalSource } from "./dbTypes";
export const enum NotificationType { export const enum NotificationType {
@ -154,32 +154,32 @@ export interface RefundFinishedNotification {
export interface ExchangeOperationErrorNotification { export interface ExchangeOperationErrorNotification {
type: NotificationType.ExchangeOperationError; type: NotificationType.ExchangeOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface RefreshOperationErrorNotification { export interface RefreshOperationErrorNotification {
type: NotificationType.RefreshOperationError; type: NotificationType.RefreshOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface RefundStatusOperationErrorNotification { export interface RefundStatusOperationErrorNotification {
type: NotificationType.RefundStatusOperationError; type: NotificationType.RefundStatusOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface RefundApplyOperationErrorNotification { export interface RefundApplyOperationErrorNotification {
type: NotificationType.RefundApplyOperationError; type: NotificationType.RefundApplyOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface PayOperationErrorNotification { export interface PayOperationErrorNotification {
type: NotificationType.PayOperationError; type: NotificationType.PayOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface ProposalOperationErrorNotification { export interface ProposalOperationErrorNotification {
type: NotificationType.ProposalOperationError; type: NotificationType.ProposalOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface TipOperationErrorNotification { export interface TipOperationErrorNotification {
@ -188,17 +188,17 @@ export interface TipOperationErrorNotification {
export interface WithdrawOperationErrorNotification { export interface WithdrawOperationErrorNotification {
type: NotificationType.WithdrawOperationError; type: NotificationType.WithdrawOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface RecoupOperationErrorNotification { export interface RecoupOperationErrorNotification {
type: NotificationType.RecoupOperationError; type: NotificationType.RecoupOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface ReserveOperationErrorNotification { export interface ReserveOperationErrorNotification {
type: NotificationType.ReserveOperationError; type: NotificationType.ReserveOperationError;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface ReserveCreatedNotification { export interface ReserveCreatedNotification {

View File

@ -21,7 +21,7 @@
/** /**
* Imports. * Imports.
*/ */
import { OperationErrorDetails, BalancesResponse } from "./walletTypes"; import { TalerErrorDetails, BalancesResponse } from "./walletTypes";
import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes"; import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes";
import { Timestamp, Duration } from "../util/time"; import { Timestamp, Duration } from "../util/time";
@ -67,7 +67,7 @@ export interface PendingExchangeUpdateOperation {
stage: ExchangeUpdateOperationStage; stage: ExchangeUpdateOperationStage;
reason: string; reason: string;
exchangeBaseUrl: string; exchangeBaseUrl: string;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
/** /**
@ -122,7 +122,7 @@ export interface PendingReserveOperation {
*/ */
export interface PendingRefreshOperation { export interface PendingRefreshOperation {
type: PendingOperationType.Refresh; type: PendingOperationType.Refresh;
lastError?: OperationErrorDetails; lastError?: TalerErrorDetails;
refreshGroupId: string; refreshGroupId: string;
finishedPerCoin: boolean[]; finishedPerCoin: boolean[];
retryInfo: RetryInfo; retryInfo: RetryInfo;
@ -137,7 +137,7 @@ export interface PendingProposalDownloadOperation {
proposalTimestamp: Timestamp; proposalTimestamp: Timestamp;
proposalId: string; proposalId: string;
orderId: string; orderId: string;
lastError?: OperationErrorDetails; lastError?: TalerErrorDetails;
retryInfo: RetryInfo; retryInfo: RetryInfo;
} }
@ -182,7 +182,7 @@ export interface PendingPayOperation {
proposalId: string; proposalId: string;
isReplay: boolean; isReplay: boolean;
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
/** /**
@ -193,14 +193,14 @@ export interface PendingRefundQueryOperation {
type: PendingOperationType.RefundQuery; type: PendingOperationType.RefundQuery;
proposalId: string; proposalId: string;
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
export interface PendingRecoupOperation { export interface PendingRecoupOperation {
type: PendingOperationType.Recoup; type: PendingOperationType.Recoup;
recoupGroupId: string; recoupGroupId: string;
retryInfo: RetryInfo; retryInfo: RetryInfo;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
/** /**
@ -209,7 +209,7 @@ export interface PendingRecoupOperation {
export interface PendingWithdrawOperation { export interface PendingWithdrawOperation {
type: PendingOperationType.Withdraw; type: PendingOperationType.Withdraw;
source: WithdrawalSource; source: WithdrawalSource;
lastError: OperationErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
retryInfo: RetryInfo; retryInfo: RetryInfo;
withdrawalGroupId: string; withdrawalGroupId: string;
numCoinsWithdrawn: number; numCoinsWithdrawn: number;

View File

@ -42,7 +42,7 @@ import {
codecForList, codecForList,
codecForAny, codecForAny,
} from "../util/codec"; } from "../util/codec";
import { OperationErrorDetails } from "./walletTypes"; import { TalerErrorDetails } from "./walletTypes";
export interface TransactionsRequest { export interface TransactionsRequest {
/** /**
@ -86,7 +86,7 @@ export interface TransactionCommon {
// Amount added or removed from the wallet's balance (including all fees and other costs) // Amount added or removed from the wallet's balance (including all fees and other costs)
amountEffective: AmountString; amountEffective: AmountString;
error?: OperationErrorDetails; error?: TalerErrorDetails;
} }
export type Transaction = export type Transaction =

View File

@ -214,7 +214,7 @@ export interface ConfirmPayResultDone {
export interface ConfirmPayResultPending { export interface ConfirmPayResultPending {
type: ConfirmPayResultType.Pending; type: ConfirmPayResultType.Pending;
lastError: OperationErrorDetails; lastError: TalerErrorDetails;
} }
export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending; export type ConfirmPayResult = ConfirmPayResultDone | ConfirmPayResultPending;
@ -494,9 +494,9 @@ export interface WalletDiagnostics {
dbOutdated: boolean; dbOutdated: boolean;
} }
export interface OperationErrorDetails { export interface TalerErrorDetails {
talerErrorCode: number; code: number;
talerErrorHint: string; hint: string;
message: string; message: string;
details: unknown; details: unknown;
} }
@ -816,7 +816,7 @@ export interface CoreApiResponseError {
type: "error"; type: "error";
operation: string; operation: string;
id: string; id: string;
error: OperationErrorDetails; error: TalerErrorDetails;
} }
export interface WithdrawTestBalanceRequest { export interface WithdrawTestBalanceRequest {