-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy patherrors.ts
More file actions
351 lines (285 loc) · 11.8 KB
/
Copy patherrors.ts
File metadata and controls
351 lines (285 loc) · 11.8 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
import { GraphQLError } from 'graphql';
export const createError = (code: string, message: string): any =>
class extends GraphQLError {
constructor({ message: explicitMessage, ...data }: { message?: string; [key: string]: any } = {}) {
super(explicitMessage || message, {
extensions: {
code,
...data,
},
});
}
};
export const PermissionSystemError = createError('PermissionSystemError', 'Permission System Error');
export const NoPermissionError = createError('NoPermissionError', 'Not authorized');
export const ProductNotFoundError = createError('ProductNotFoundError', 'Product not found');
export const ProductVariationNotFoundError = createError(
'ProductVariationNotFoundError',
'Product variation not found',
);
export const ProductMediaNotFoundError = createError(
'ProductMediaNotFoundError',
'Product media not found',
);
export const ProductReviewNotFoundError = createError(
'ProductReviewNotFoundError',
'ProductReview not found',
);
export const ProductWrongStatusError = createError(
'ProductWrongStatusError',
'The current status of the product does not allow this operation',
);
export const ProductWrongTypeError = createError(
'ProductWrongTypeError',
'The current type of the product does not allow this operation',
);
export const ProductVariationInfinityLoop = createError(
'ProductInfinityLoop',
'Assigning the proxy to itself as child in product assignments is not allowed, this would create an infinite loop',
);
export const AssortmentNotFoundError = createError('AssortmentNotFoundError', 'Assortment not found');
export const AssortmentFilterNotFoundError = createError(
'AssortmentFilterNotFoundError',
'Assortment filter not found',
);
export const AssortmentLinkNotFoundError = createError(
'AssortmentLinkNotFoundError',
'Assortment link not found',
);
export const AssortmentProductNotFoundError = createError(
'AssortmentProductNotFoundError',
'Assortment product not found',
);
export const AssortmentMediaNotFoundError = createError(
'AssortmentMediaNotFoundError',
'Assortment media not found',
);
export const FilterNotFoundError = createError('FilterNotFoundError', 'Filter not found');
export const CountryNotFoundError = createError('CountryNotFoundError', 'Country not found');
export const CurrencyNotFoundError = createError('CurrencyNotFoundError', 'Currency not found');
export const DeliverProviderNotFoundError = createError(
'DeliverProviderNotFoundError',
'Delivery provider not found',
);
export const LanguageNotFoundError = createError('LanguageNotFoundError', 'Language not found');
export const UserNotFoundError = createError('UserNotFoundError', 'User not found');
export const LastAdminError = createError(
'LastAdminError',
'At least one active administrator is required. Assign another administrator before removing this account or revoking its admin role.',
);
export const UserWebAuthnCredentialsNotFoundError = createError(
'UserWebAuthnCredentialsNotFoundError',
'User WebAuth Credentials not found',
);
export const WebAuthnDisabledError = createError('WebAuthnDisabledError', 'WebAuthn disabled');
export const UserWeb3AddressNotFoundError = createError(
'UserWeb3AddressNotFoundError',
'Web3 Account not found for User',
);
export const UserWeb3InvalidAddressError = createError(
'UserWeb3InvalidAddressError',
'Invalid address provided',
);
export const UserWeb3AddressSignatureError = createError(
'UserWeb3AddressSignatureError',
'Signature does not match web3 account / is invalid',
);
export const UserNoCartError = createError('UserNoCartError', 'No open cart available to checkout');
export const OrderItemNotFoundError = createError('OrderItemNotFoundError', 'Order Item not found');
export const OrderNotFoundError = createError('OrderNotFoundError', 'Order not found');
export const OrderNumberAlreadyExistsError = createError(
'OrderNumberAlreadyExistsError',
'This orderNumber has already been used by another order',
);
export const OrderDiscountNotFoundError = createError(
'OrderDiscountNotFoundError',
'Order discount not found',
);
export const OrderDiscountCodeNotValidError = createError(
'OrderDiscountCodeNotValidError',
'Order discount code not valid',
);
export const OrderDiscountCodeAlreadyPresentError = createError(
'OrderDiscountCodeAlreadyPresentError',
'Order discount code already present',
);
export const OrderDeliveryNotFoundError = createError(
'OrderDeliveryNotFoundError',
'Order delivery not found',
);
export const OrderPaymentNotFoundError = createError(
'OrderPaymentNotFoundError',
'Order payment not found',
);
export const OrderPaymentTypeError = createError(
'OrderPaymentTypeError',
'The current type of the order payment does not allow this operation',
);
export const OrderQuantityTooLowError = createError(
'OrderQuantityTooLowError',
'Quantity cannot be lower than 1',
);
export const OrderWrongPaymentStatusError = createError(
'OrderWrongPaymentStatus',
'The current status of the payment does not allow this operation',
);
export const OrderWrongDeliveryStatusError = createError(
'OrderWrongDeliveryStatus',
'The current status of the delivery does not allow this operation',
);
export const OrderDeliveryTypeError = createError(
'OrderDeliveryTypeError',
'The current type of the order delivery does not allow this operation',
);
export const OrderWrongStatusError = createError(
'OrderWrongStatusError',
'The current status of the order does not allow this operation',
);
export const OrderCheckoutError = createError(
'OrderCheckoutError',
'A problem occured while processing the order',
);
export const OrderPaymentConfigurationError = createError(
'OrderPaymentConfigurationError',
'Payment configuration invalid',
);
export const QuotationWrongStatusError = createError(
'QuotationWrongStatusError',
'The current status of the quotation does not allow this operation',
);
export const QuotationItemConfigurationError = createError(
'QuotationItemConfigurationError',
'Could not transform quotation item',
);
export const QuotationNotFoundError = createError('QuotationNotFoundError', 'Quotation not found');
export const BookmarkAlreadyExistsError = createError(
'BookmarkAlreadyExistsError',
'Bookmark already exists',
);
export const BookmarkNotFoundError = createError('BookmarkNotFoundError', 'Bookmark not found');
export const MultipleBookmarksFound = createError(
'MultipleBookmarksFound',
'The convenience bookmark mutation cannot be used because multiple bookmarks were explicitly created with different metadata',
);
export const PaymentProviderNotFoundError = createError(
'PaymentProviderNotFoundError',
'Payment provider not found',
);
export const WorkNotFoundOrWrongStatus = createError(
'WorkNotFoundOrWrongStatus',
'Could not find work or no work with the correct status',
);
export const WorkNotFoundError = createError('WorkNotFoundError', 'Work not found');
export const WorkTypeInvalidError = createError('WorkTypeInvalidError', 'Work type invalid');
export const PaymentCredentialsNotFoundError = createError(
'PaymentCredentialsNotFoundError',
'Payment credentials not found',
);
export const EnrollmentWrongStatusError = createError(
'EnrollmentWrongStatusError',
'The current status of the enrollment does not allow this operation',
);
export const EnrollmentNotFoundError = createError('EnrollmentNotFoundError', 'Enrollment not found');
export const WarehousingProviderNotFoundError = createError(
'WarehousingProviderNotFoundError',
'Warehousing provider not found',
);
export const InvalidIdError = createError('InvalidIdError', 'Invalid ID provided');
export const BulkOperationTooLargeError = createError(
'BulkOperationTooLargeError',
'Bulk operation exceeds the maximum number of entities',
);
export const ProviderConfigurationInvalid = createError(
'ProviderConfigurationInvalid',
'Provider Configuration invalid (check if the Adapter Key exists)',
);
export const TokenWrongStatusError = createError(
'TokenWrongStatusError',
'The current status of the token does not allow this operation',
);
export const TokenNotFoundError = createError('TokenNotFoundError', 'Token not found');
export const CyclicAssortmentLinkNotSupportedError = createError(
'CyclicAssortmentLinkNotSupported',
'Cyclic assortment link detected, make sure child assortment is not assigned as a parent on the assortment graph',
);
export const CyclicProductBundlingNotSupportedError = createError(
'CyclicBundlingNotSupportedError',
'Cyclic bundling detected, make sure bundled product is not the same as the bundle product itself',
);
export const EmailAlreadyExistsError = createError(
'EmailAlreadyExists',
'Email already exists or is invalid',
);
export const UsernameAlreadyExistsError = createError(
'UsernameAlreadyExists',
'Username already exists or is invalid',
);
export const UsernameOrEmailRequiredError = createError(
'UsernameOrEmailRequired',
'No username or email is provided.',
);
export const PasswordInvalidError = createError(
'PasswordInvalidError',
'The provided password is invalid, maybe too insecure',
);
export const PasswordOrWebAuthnPublicKeyRequiredError = createError(
'PasswordOrWebAuthnPublicKeyRequired',
'A password or a WebAuthn public key is required',
);
export const WebAuthnVerificationFailedError = createError(
'WebAuthnVerificationFailedError',
'WebAuthn credential verification failed',
);
export const InvalidCredentialsError = createError('InvalidCredentials', 'Invalid credentials provided');
export const InvalidResetTokenError = createError('InvalidResetTokenError', 'Token invalid or expired');
export const InvalidEmailVerificationTokenError = createError(
'InvalidEmailVerificationTokenError',
'Token invalid or expired',
);
export const NoEmailSetError = createError('NoEmailSet', 'User has no email set');
export const ResetPasswordLinkUnknownAddressError = createError(
'ResetPasswordLinkUnknownAddress',
'Valid token but no email address found for the entry',
);
export const UserDeactivatedError = createError(
'UserDeactivatedError',
'User is deactivated, so not allowed to login',
);
export const AuthOperationFailedError = createError(
'AuthOperationFailed',
'Operation failed, please make sure you have provided all required parameters',
);
export const ProductLinkedToActiveVariationError = createError(
'ProductLinkedToActiveVariation',
'Product is part of a active variation, remove it from any active/draft variation before deleting',
);
export const ProductLinkedToActiveBundleError = createError(
'ProductLinkedToActiveBundle',
'Product is part of a active/draft bundle item, remove it from any active/draft bundle item before deleting',
);
export const ProductLinkedToEnrollmentError = createError(
'ProductLinkedToEnrollment',
'Product is part of a active/paused subscriptions item, remove it from any active/paused subscriptions item before deleting',
);
export const ProductLinkedToQuotationError = createError(
'ProductLinkedToQuotation',
'Product is part of a requested/proposed quotations item, remove it from any requested/proposed quotations item before deleting',
);
export const ProductVariationVectorAlreadySet = createError(
'ProductVariationVectorAlreadySet',
'Product variation vector is already set, remove the existing one before setting a new one',
);
export const ProductVariationVectorInvalid = createError(
'ProductVariationVectorInvalid',
'Product variation vector is invalid/incomplete',
);
export const FileNotFoundError = createError('FileNotFoundError', 'File not found');
export const FileUploadExpiredError = createError('FileUploadExpired', 'File upload has expired');
export const ImpersonatingAdminUserError = createError(
'ImpersonatingAdminUserError',
'Can not impersonate a admin user account',
);
export const DuplicateFilterKeyError = createError(
'DuplicateFilterKeyError',
'Key already registered for another filter',
);