diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-22 14:22:03 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-22 14:22:03 +0530 |
commit | e60563fb540c04d9ba751fea69c1fc0f1de598b5 (patch) | |
tree | 45f7c86b66dc150d413f9855efaa6341e4a44624 /src/types/notifications.ts | |
parent | f4a8702b3cf93f9edf96d1d1c8cb88baa309e301 (diff) | |
download | wallet-core-e60563fb540c04d9ba751fea69c1fc0f1de598b5.tar.xz |
consistent error handling for HTTP request (and some other things)
Diffstat (limited to 'src/types/notifications.ts')
-rw-r--r-- | src/types/notifications.ts | 23 |
1 files changed, 18 insertions, 5 deletions
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; |