From e60563fb540c04d9ba751fea69c1fc0f1de598b5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 22 Jul 2020 14:22:03 +0530 Subject: consistent error handling for HTTP request (and some other things) --- src/types/notifications.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/types/notifications.ts') diff --git a/src/types/notifications.ts b/src/types/notifications.ts index ac30b6fe2..5d6d2ee11 100644 --- a/src/types/notifications.ts +++ b/src/types/notifications.ts @@ -22,7 +22,7 @@ /** * Imports. */ -import { OperationError } from "./walletTypes"; +import { OperationErrorDetails } from "./walletTypes"; import { WithdrawalSource } from "./dbTypes"; export const enum NotificationType { @@ -54,6 +54,7 @@ export const enum NotificationType { TipOperationError = "tip-error", PayOperationError = "pay-error", WithdrawOperationError = "withdraw-error", + ReserveNotYetFound = "reserve-not-yet-found", ReserveOperationError = "reserve-error", InternalError = "internal-error", PendingOperationProcessed = "pending-operation-processed", @@ -72,6 +73,11 @@ export interface InternalErrorNotification { exception: any; } +export interface ReserveNotYetFoundNotification { + type: NotificationType.ReserveNotYetFound; + reservePub: string; +} + export interface CoinWithdrawnNotification { type: NotificationType.CoinWithdrawn; } @@ -148,27 +154,32 @@ export interface RefundFinishedNotification { export interface ExchangeOperationErrorNotification { type: NotificationType.ExchangeOperationError; + error: OperationErrorDetails; } export interface RefreshOperationErrorNotification { type: NotificationType.RefreshOperationError; + error: OperationErrorDetails; } export interface RefundStatusOperationErrorNotification { type: NotificationType.RefundStatusOperationError; + error: OperationErrorDetails; } export interface RefundApplyOperationErrorNotification { type: NotificationType.RefundApplyOperationError; + error: OperationErrorDetails; } export interface PayOperationErrorNotification { type: NotificationType.PayOperationError; + error: OperationErrorDetails; } export interface ProposalOperationErrorNotification { type: NotificationType.ProposalOperationError; - error: OperationError; + error: OperationErrorDetails; } export interface TipOperationErrorNotification { @@ -177,16 +188,17 @@ export interface TipOperationErrorNotification { export interface WithdrawOperationErrorNotification { type: NotificationType.WithdrawOperationError; - error: OperationError, + error: OperationErrorDetails; } export interface RecoupOperationErrorNotification { type: NotificationType.RecoupOperationError; + error: OperationErrorDetails; } export interface ReserveOperationErrorNotification { type: NotificationType.ReserveOperationError; - operationError: OperationError; + error: OperationErrorDetails; } export interface ReserveCreatedNotification { @@ -238,4 +250,5 @@ export type WalletNotification = | InternalErrorNotification | PendingOperationProcessedNotification | ProposalRefusedNotification - | ReserveRegisteredWithBankNotification; \ No newline at end of file + | ReserveRegisteredWithBankNotification + | ReserveNotYetFoundNotification; -- cgit v1.2.3