-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patherror.ts
47 lines (41 loc) · 954 Bytes
/
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
import type { PlainGraphQLError } from './graphql-utlities';
import type { MutationErrorPartsFragment } from './graphql/types';
/* 400 */
export type BadRequestError = {
type: 'bad_request';
message: string;
graphqlErrors: PlainGraphQLError[];
requestId?: string;
};
/* 401 */
export type ForbiddenError = {
type: 'forbidden';
message: string;
requestId?: string;
};
/* 500 */
export type InternalServerError = {
type: 'internal_server_error';
message: string;
requestId?: string;
};
/* Unhandled/unexpected errors */
export type UnknownError = {
type: 'unknown';
message: string;
err?: unknown;
requestId?: string;
};
/* Handled mutation errors */
export type MutationError = {
type: 'mutation_error';
message: string;
errorDetails: MutationErrorPartsFragment;
requestId?: string;
};
export type PlainSDKError =
| ForbiddenError
| BadRequestError
| InternalServerError
| MutationError
| UnknownError;