forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.ts
60 lines (53 loc) · 1.48 KB
/
error.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*!
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Different error types the Container may report out to the Host
*/
export enum ContainerErrorType {
/**
* Some error, most likely an exception caught by runtime and propagated to container as critical error
*/
genericError = "genericError",
/**
* Throttling error from server. Server is busy and is asking not to reconnect for some time
*/
throttlingError = "throttlingError",
}
/**
* Base interface for all errors and warnings at container level
*/
export interface IErrorBase {
/** errorType is a union of error types from
* - container
* - runtime
* - drivers
*/
readonly errorType: string;
readonly message: string;
/** Sequence number when error happened */
sequenceNumber?: number;
}
/**
* Represents warnings raised on container.
*/
export type ContainerWarning = IErrorBase;
/**
* Represents errors raised on container.
*/
export type ICriticalContainerError = IErrorBase;
/**
* Generic wrapper for an unrecognized/uncategorized error object
*/
export interface IGenericError extends IErrorBase {
readonly errorType: ContainerErrorType.genericError;
error?: any;
}
/**
* Warning emitted when requests to storage are being throttled
*/
export interface IThrottlingWarning extends IErrorBase {
readonly errorType: ContainerErrorType.throttlingError;
readonly retryAfterSeconds: number;
}