-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathserver.ts
More file actions
54 lines (54 loc) · 1.16 KB
/
server.ts
File metadata and controls
54 lines (54 loc) · 1.16 KB
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
/**
* Server-side HTTP error codes
* These errors are used for server responses and API errors
*/
export const serverErrors = {
UNEXPECTED_ERROR: {
code: 'UNEXPECTED_ERROR',
message: 'An unexpected error occurred',
},
SERVER_ERROR: {
code: 'SERVER_ERROR',
message: 'An internal server error occurred',
},
BAD_REQUEST: {
code: 'BAD_REQUEST',
message: 'Invalid request',
},
NOT_FOUND: {
code: 'NOT_FOUND',
message: 'Resource not found',
},
UNAUTHORIZED: {
code: 'UNAUTHORIZED',
message: 'Authentication required',
},
FORBIDDEN: {
code: 'FORBIDDEN',
message: 'Access forbidden',
},
INVALID_INPUT: {
code: 'INVALID_INPUT',
message: 'Invalid input provided',
},
CONFLICT: {
code: 'CONFLICT',
message: 'Resource conflict',
},
RATE_LIMIT_EXCEEDED: {
code: 'RATE_LIMIT_EXCEEDED',
message: 'Rate limit exceeded',
},
BAD_GATEWAY: {
code: 'BAD_GATEWAY',
message: 'Bad gateway',
},
SERVICE_UNAVAILABLE: {
code: 'SERVICE_UNAVAILABLE',
message: 'Service unavailable',
},
GATEWAY_TIMEOUT: {
code: 'GATEWAY_TIMEOUT',
message: 'Gateway timeout',
},
} as const