-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patherrors.ts
More file actions
93 lines (82 loc) · 2.04 KB
/
Copy patherrors.ts
File metadata and controls
93 lines (82 loc) · 2.04 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
export class ConfigurationError extends Error {
constructor(message: string) {
super(message);
this.name = 'ConfigurationError';
}
}
export class APIError extends Error {
constructor(message: string) {
super(message);
this.name = 'APIError';
}
}
// api error bad request 400
export class BadRequestError extends APIError {
constructor(message: string) {
super(message);
this.name = 'BadRequestError';
}
}
// api error unauthorized 401
export class UnauthorizedError extends APIError {
constructor(message: string) {
super(message);
this.name = 'UnauthorizedError';
}
}
// api error forbidden 403
export class ForbiddenError extends APIError {
constructor(message: string) {
super(message);
this.name = 'ForbiddenError';
}
}
// api error not found 404
export class NotFoundError extends APIError {
constructor(message: string) {
super(message);
this.name = 'NotFoundError';
}
}
// api error user unauthorized 419
export class UserUnauthorizedError extends APIError {
constructor(message: string) {
super(message);
this.name = 'UserUnauthorizedError';
}
}
// api error invalid param 422
export class InvalidParametersError extends APIError {
constructor(message: string) {
super(message);
this.name = 'InvalidParametersError';
}
}
// api error invalid param 422, subtype
export class InvalidRequestTokenError extends InvalidParametersError {
constructor(message: string) {
super(message);
this.name = 'InvalidRequestTokenError';
}
}
// api error rate limited 429
export class RateLimitError extends APIError {
constructor(message: string) {
super(message);
this.name = 'RateLimitError';
}
}
// all internal server errors
export class InternalServerError extends APIError {
constructor(message: string) {
super(message);
this.name = 'InternalServerError';
}
}
// webhook signature did not match
export class WebhookVerificationError extends Error {
constructor(message: string) {
super(message);
this.name = 'WebhookVerificationError';
}
}