-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patherror.ts
More file actions
104 lines (92 loc) · 2.6 KB
/
error.ts
File metadata and controls
104 lines (92 loc) · 2.6 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
94
95
96
97
98
99
100
101
102
103
104
/** error types returned by Scrapbox REST API
*
* `name` may not exist
*/
export interface ErrorLike {
/** error name */
name: string;
/** error message */
message: string;
}
/** error that occurs when calling API on a private project you haven't joined */
export interface NotMemberError extends ErrorLike {
/** error name */
name: "NotMemberError";
}
/** error that occurs when the specified project or page is not found */
export interface NotFoundError extends ErrorLike {
/** error name */
name: "NotFoundError";
}
/** error that occurs when owner/admin privileges are insufficient */
export interface NotPrivilegeError extends ErrorLike {
/** error name */
name: "NotPrivilegeError";
}
/** error that occurs when calling an API that requires login without being logged in */
export interface NotLoggedInError extends ErrorLike {
/** error name */
name: "NotLoggedInError";
/** detailed information */
details: {
/** name of the project you tried to access */
project: string;
/** available login methods */
loginStrategies: (
| "google"
| "github"
| "microsoft"
| "gyazo"
| "email"
| "saml"
| "easy-trial"
)[];
};
}
/** error that occurs when CSRF token is invalid */
export interface SessionError extends ErrorLike {
/** error name */
name: "SessionError";
}
/** error returned when passing an invalid URL
*
* note that in actual response, only message is returned
*/
export interface InvalidURLError extends ErrorLike {
/** error name */
name: "InvalidURLError";
}
/** error when normal response is not returned from the URL destination page */
export interface BadRequestError extends ErrorLike {
/** error name */
name: "BadRequestError";
}
/** error that appears when you don't pass a search string
*
* note that in actual response, only message is returned
*/
export interface NoQueryError extends ErrorLike {
/** error name */
name: "NoQueryError";
}
/** error that occurs when an invalid followingId is passed
*
* note that in actual response, only message is returned
*/
export interface InvalidFollowingIdError extends ErrorLike {
name: "InvalidFollowingIdError";
}
/** error that occurs when capacity is exhausted
*
* note that in actual response, only message is returned
*/
export interface FileCapacityError extends ErrorLike {
name: "FileCapacityError";
}
/** Google Cloud Storage XML API error
*
* `message` contains XML in [this format](https://cloud.google.com/storage/docs/xml-api/reference-status#http-status-and-error-codes)
*/
export interface GCSError extends ErrorLike {
name: "GCSError";
}