/
StatusCodes.ts
61 lines (51 loc) · 1.34 KB
/
StatusCodes.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
61
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* @ignore
*/
export const StatusCode = {
// Success
Ok: 200 as 200,
Created: 201 as 201,
Accepted: 202 as 202,
NoContent: 204 as 204,
NotModified: 304 as 304,
// Client error
BadRequest: 400 as 400,
Unauthorized: 401 as 401,
Forbidden: 403 as 403,
NotFound: 404 as 404,
MethodNotAllowed: 405 as 405,
RequestTimeout: 408 as 408,
Conflict: 409 as 409,
Gone: 410 as 410,
PreconditionFailed: 412 as 412,
RequestEntityTooLarge: 413 as 413,
TooManyRequests: 429 as 429,
RetryWith: 449 as 449,
// Server Error
InternalServerError: 500 as 500,
ServiceUnavailable: 503 as 503,
// Operation pause and cancel. These are FAKE status codes for QOS logging purpose only.
OperationPaused: 1200 as 1200,
OperationCancelled: 1201
};
/**
* @ignore
*/
export type StatusCode = typeof StatusCode[keyof typeof StatusCode];
/**
* @ignore
*/
export const SubStatusCode = {
Unknown: 0 as 0,
// 400: Bad Request Substatus
CrossPartitionQueryNotServable: 1004 as 1004,
// 410: StatusCodeType_Gone: substatus
PartitionKeyRangeGone: 1002 as 1002,
// 404: NotFound Substatus
ReadSessionNotAvailable: 1002 as 1002,
// 403: Forbidden Substatus
WriteForbidden: 3
};
export type SubStatusCode = typeof SubStatusCode[keyof typeof SubStatusCode];