@devp0nt/error0 1.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,702 @@
1
+ import * as undici_types from 'undici-types';
2
+ import { Meta0 } from '@devp0nt/meta0';
3
+ import { HttpStatusCode, AxiosError } from 'axios';
4
+ import { ZodError } from 'zod';
5
+
6
+ interface Error0Input {
7
+ message?: string;
8
+ tag?: string;
9
+ code?: string;
10
+ httpStatus?: HttpStatusCode | HttpStatusCodeString;
11
+ expected?: boolean | ExpectedFn;
12
+ clientMessage?: string;
13
+ cause?: Error0Cause;
14
+ stack?: string;
15
+ meta?: Meta0.Meta0OrValueTypeNullish;
16
+ zodError?: ZodError;
17
+ axiosError?: AxiosError;
18
+ }
19
+ interface Error0GeneralProps {
20
+ message: Error0Input['message'];
21
+ tag: Error0Input['tag'];
22
+ code: Error0Input['code'];
23
+ httpStatus: number | undefined;
24
+ expected: boolean | undefined;
25
+ clientMessage: Error0Input['clientMessage'];
26
+ anyMessage: string | undefined;
27
+ cause: Error0Input['cause'];
28
+ stack: Error['stack'];
29
+ meta: Meta0.ValueType;
30
+ zodError?: ZodError;
31
+ axiosError?: AxiosError;
32
+ }
33
+ type HttpStatusCodeString = keyof typeof HttpStatusCode;
34
+ type Error0Cause = Error | Error0 | unknown;
35
+ type ExpectedFn = (error: Error0GeneralProps) => boolean | undefined;
36
+ declare class Error0 extends Error {
37
+ readonly __I_AM_ERROR_0: true;
38
+ readonly tag?: Error0GeneralProps['tag'];
39
+ readonly code?: Error0GeneralProps['code'];
40
+ readonly httpStatus?: Error0GeneralProps['httpStatus'];
41
+ readonly expected?: Error0GeneralProps['expected'];
42
+ readonly clientMessage?: Error0GeneralProps['clientMessage'];
43
+ readonly anyMessage?: Error0GeneralProps['anyMessage'];
44
+ readonly cause?: Error0GeneralProps['cause'];
45
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
46
+ readonly zodError?: Error0GeneralProps['zodError'];
47
+ readonly axiosError?: Error0GeneralProps['axiosError'];
48
+ static defaultMessage: string;
49
+ static defaultCode?: Error0GeneralProps['code'];
50
+ static defaultHttpStatus?: Error0GeneralProps['httpStatus'];
51
+ static defaultExpected?: Error0GeneralProps['expected'];
52
+ static defaultClientMessage?: Error0GeneralProps['clientMessage'];
53
+ static defaultMeta?: Meta0.Meta0OrValueTypeNullish;
54
+ readonly propsOriginal: Error0GeneralProps;
55
+ constructor(message: string);
56
+ constructor(input: Error0Input);
57
+ constructor(message: string, input: Error0Input);
58
+ constructor(error: Error);
59
+ constructor(error: Error, input: Error0Input);
60
+ constructor(value: unknown);
61
+ constructor(value: unknown, input: Error0Input);
62
+ static defaultMaxLevel: number;
63
+ static _safeParseInput(error0Input: Record<string, unknown>): Error0Input;
64
+ static _getSelfGeneralProps({ error0Input, message, stack, }: {
65
+ error0Input: Error0Input;
66
+ message: string;
67
+ stack: Error0GeneralProps['stack'];
68
+ }): Error0GeneralProps;
69
+ static _getSelfPropsFloated(causesProps: Error0GeneralProps[]): Error0GeneralProps;
70
+ static _getExtraError0PropsByZodError(zodError: ZodError): Partial<Error0GeneralProps>;
71
+ static _getExtraError0PropsByAxiosError(axiosError: AxiosError): Partial<Error0GeneralProps>;
72
+ static _assignError0Props(error0Props: Error0GeneralProps, extraError0Props: Partial<Error0GeneralProps>): void;
73
+ static _normalizeSelfExpected(error0Props: Error0GeneralProps, expectedProvided: Error0Input['expected']): boolean | undefined;
74
+ static _isExpected(causesProps: Error0GeneralProps[]): boolean;
75
+ static _getPropsFromUnknown(error: unknown, defaults?: Error0Input): Error0GeneralProps;
76
+ static _getCausesPropsFromUnknown(error: unknown, maxLevel: number): Error0GeneralProps[];
77
+ static _getCausesPropsFromError0Props(error0Props: Error0GeneralProps, maxLevel: number): Error0GeneralProps[];
78
+ static _getClosestPropValue<TPropKey extends keyof Error0GeneralProps>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]> | undefined;
79
+ static _getFilledPropValues<TPropKey extends keyof Error0Input>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]>[];
80
+ static _getMergedMetaValue(causesProps: Error0GeneralProps[]): Meta0.ValueType;
81
+ static _removeConstructorStackPart(stack: Error0GeneralProps['stack']): Error0GeneralProps['stack'];
82
+ static _mergeStack(prevStack: Error0GeneralProps['stack'], nextStack: Error0GeneralProps['stack']): Error0GeneralProps['stack'];
83
+ static isError0(error: unknown): error is Error0;
84
+ static isLikelyError0(error: unknown): error is Error0;
85
+ static _toError0(error: unknown, inputOverride?: Error0Input): Error0;
86
+ static from(error: unknown, inputOverride?: Error0Input): Error0;
87
+ static extend(props: {
88
+ defaultMessage?: Error0GeneralProps['message'];
89
+ defaultCode?: Error0GeneralProps['code'];
90
+ defaultHttpStatus?: Error0GeneralProps['httpStatus'];
91
+ defaultExpected?: Error0GeneralProps['expected'];
92
+ defaultClientMessage?: Error0GeneralProps['clientMessage'];
93
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
94
+ }): {
95
+ new (message: string): {
96
+ readonly __I_AM_ERROR_0: true;
97
+ readonly tag?: Error0GeneralProps["tag"];
98
+ readonly code?: Error0GeneralProps["code"];
99
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
100
+ readonly expected?: Error0GeneralProps["expected"];
101
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
102
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
103
+ readonly cause?: Error0GeneralProps["cause"];
104
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
105
+ readonly zodError?: Error0GeneralProps["zodError"];
106
+ readonly axiosError?: Error0GeneralProps["axiosError"];
107
+ readonly propsOriginal: Error0GeneralProps;
108
+ toJSON(): {
109
+ message: string;
110
+ tag: string | undefined;
111
+ code: string | undefined;
112
+ httpStatus: number | undefined;
113
+ expected: boolean | undefined;
114
+ clientMessage: string | undefined;
115
+ anyMessage: string | undefined;
116
+ cause: unknown;
117
+ meta: Meta0.ValueType;
118
+ stack: string | undefined;
119
+ __I_AM_ERROR_0: true;
120
+ };
121
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
122
+ name: string;
123
+ message: string;
124
+ stack?: string;
125
+ };
126
+ new (input: Error0Input): {
127
+ readonly __I_AM_ERROR_0: true;
128
+ readonly tag?: Error0GeneralProps["tag"];
129
+ readonly code?: Error0GeneralProps["code"];
130
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
131
+ readonly expected?: Error0GeneralProps["expected"];
132
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
133
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
134
+ readonly cause?: Error0GeneralProps["cause"];
135
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
136
+ readonly zodError?: Error0GeneralProps["zodError"];
137
+ readonly axiosError?: Error0GeneralProps["axiosError"];
138
+ readonly propsOriginal: Error0GeneralProps;
139
+ toJSON(): {
140
+ message: string;
141
+ tag: string | undefined;
142
+ code: string | undefined;
143
+ httpStatus: number | undefined;
144
+ expected: boolean | undefined;
145
+ clientMessage: string | undefined;
146
+ anyMessage: string | undefined;
147
+ cause: unknown;
148
+ meta: Meta0.ValueType;
149
+ stack: string | undefined;
150
+ __I_AM_ERROR_0: true;
151
+ };
152
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
153
+ name: string;
154
+ message: string;
155
+ stack?: string;
156
+ };
157
+ new (message: string, input: Error0Input): {
158
+ readonly __I_AM_ERROR_0: true;
159
+ readonly tag?: Error0GeneralProps["tag"];
160
+ readonly code?: Error0GeneralProps["code"];
161
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
162
+ readonly expected?: Error0GeneralProps["expected"];
163
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
164
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
165
+ readonly cause?: Error0GeneralProps["cause"];
166
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
167
+ readonly zodError?: Error0GeneralProps["zodError"];
168
+ readonly axiosError?: Error0GeneralProps["axiosError"];
169
+ readonly propsOriginal: Error0GeneralProps;
170
+ toJSON(): {
171
+ message: string;
172
+ tag: string | undefined;
173
+ code: string | undefined;
174
+ httpStatus: number | undefined;
175
+ expected: boolean | undefined;
176
+ clientMessage: string | undefined;
177
+ anyMessage: string | undefined;
178
+ cause: unknown;
179
+ meta: Meta0.ValueType;
180
+ stack: string | undefined;
181
+ __I_AM_ERROR_0: true;
182
+ };
183
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
184
+ name: string;
185
+ message: string;
186
+ stack?: string;
187
+ };
188
+ new (error: Error): {
189
+ readonly __I_AM_ERROR_0: true;
190
+ readonly tag?: Error0GeneralProps["tag"];
191
+ readonly code?: Error0GeneralProps["code"];
192
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
193
+ readonly expected?: Error0GeneralProps["expected"];
194
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
195
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
196
+ readonly cause?: Error0GeneralProps["cause"];
197
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
198
+ readonly zodError?: Error0GeneralProps["zodError"];
199
+ readonly axiosError?: Error0GeneralProps["axiosError"];
200
+ readonly propsOriginal: Error0GeneralProps;
201
+ toJSON(): {
202
+ message: string;
203
+ tag: string | undefined;
204
+ code: string | undefined;
205
+ httpStatus: number | undefined;
206
+ expected: boolean | undefined;
207
+ clientMessage: string | undefined;
208
+ anyMessage: string | undefined;
209
+ cause: unknown;
210
+ meta: Meta0.ValueType;
211
+ stack: string | undefined;
212
+ __I_AM_ERROR_0: true;
213
+ };
214
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
215
+ name: string;
216
+ message: string;
217
+ stack?: string;
218
+ };
219
+ new (error: Error, input: Error0Input): {
220
+ readonly __I_AM_ERROR_0: true;
221
+ readonly tag?: Error0GeneralProps["tag"];
222
+ readonly code?: Error0GeneralProps["code"];
223
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
224
+ readonly expected?: Error0GeneralProps["expected"];
225
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
226
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
227
+ readonly cause?: Error0GeneralProps["cause"];
228
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
229
+ readonly zodError?: Error0GeneralProps["zodError"];
230
+ readonly axiosError?: Error0GeneralProps["axiosError"];
231
+ readonly propsOriginal: Error0GeneralProps;
232
+ toJSON(): {
233
+ message: string;
234
+ tag: string | undefined;
235
+ code: string | undefined;
236
+ httpStatus: number | undefined;
237
+ expected: boolean | undefined;
238
+ clientMessage: string | undefined;
239
+ anyMessage: string | undefined;
240
+ cause: unknown;
241
+ meta: Meta0.ValueType;
242
+ stack: string | undefined;
243
+ __I_AM_ERROR_0: true;
244
+ };
245
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
246
+ name: string;
247
+ message: string;
248
+ stack?: string;
249
+ };
250
+ new (value: unknown): {
251
+ readonly __I_AM_ERROR_0: true;
252
+ readonly tag?: Error0GeneralProps["tag"];
253
+ readonly code?: Error0GeneralProps["code"];
254
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
255
+ readonly expected?: Error0GeneralProps["expected"];
256
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
257
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
258
+ readonly cause?: Error0GeneralProps["cause"];
259
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
260
+ readonly zodError?: Error0GeneralProps["zodError"];
261
+ readonly axiosError?: Error0GeneralProps["axiosError"];
262
+ readonly propsOriginal: Error0GeneralProps;
263
+ toJSON(): {
264
+ message: string;
265
+ tag: string | undefined;
266
+ code: string | undefined;
267
+ httpStatus: number | undefined;
268
+ expected: boolean | undefined;
269
+ clientMessage: string | undefined;
270
+ anyMessage: string | undefined;
271
+ cause: unknown;
272
+ meta: Meta0.ValueType;
273
+ stack: string | undefined;
274
+ __I_AM_ERROR_0: true;
275
+ };
276
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
277
+ name: string;
278
+ message: string;
279
+ stack?: string;
280
+ };
281
+ new (value: unknown, input: Error0Input): {
282
+ readonly __I_AM_ERROR_0: true;
283
+ readonly tag?: Error0GeneralProps["tag"];
284
+ readonly code?: Error0GeneralProps["code"];
285
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
286
+ readonly expected?: Error0GeneralProps["expected"];
287
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
288
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
289
+ readonly cause?: Error0GeneralProps["cause"];
290
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
291
+ readonly zodError?: Error0GeneralProps["zodError"];
292
+ readonly axiosError?: Error0GeneralProps["axiosError"];
293
+ readonly propsOriginal: Error0GeneralProps;
294
+ toJSON(): {
295
+ message: string;
296
+ tag: string | undefined;
297
+ code: string | undefined;
298
+ httpStatus: number | undefined;
299
+ expected: boolean | undefined;
300
+ clientMessage: string | undefined;
301
+ anyMessage: string | undefined;
302
+ cause: unknown;
303
+ meta: Meta0.ValueType;
304
+ stack: string | undefined;
305
+ __I_AM_ERROR_0: true;
306
+ };
307
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
308
+ name: string;
309
+ message: string;
310
+ stack?: string;
311
+ };
312
+ defaultMessage: string;
313
+ defaultCode: string | undefined;
314
+ defaultHttpStatus: number | undefined;
315
+ defaultExpected: boolean | undefined;
316
+ defaultClientMessage: string | undefined;
317
+ defaultMeta: Meta0;
318
+ defaultMaxLevel: number;
319
+ _safeParseInput(error0Input: Record<string, unknown>): Error0Input;
320
+ _getSelfGeneralProps({ error0Input, message, stack, }: {
321
+ error0Input: Error0Input;
322
+ message: string;
323
+ stack: Error0GeneralProps["stack"];
324
+ }): Error0GeneralProps;
325
+ _getSelfPropsFloated(causesProps: Error0GeneralProps[]): Error0GeneralProps;
326
+ _getExtraError0PropsByZodError(zodError: ZodError): Partial<Error0GeneralProps>;
327
+ _getExtraError0PropsByAxiosError(axiosError: AxiosError): Partial<Error0GeneralProps>;
328
+ _assignError0Props(error0Props: Error0GeneralProps, extraError0Props: Partial<Error0GeneralProps>): void;
329
+ _normalizeSelfExpected(error0Props: Error0GeneralProps, expectedProvided: Error0Input["expected"]): boolean | undefined;
330
+ _isExpected(causesProps: Error0GeneralProps[]): boolean;
331
+ _getPropsFromUnknown(error: unknown, defaults?: Error0Input): Error0GeneralProps;
332
+ _getCausesPropsFromUnknown(error: unknown, maxLevel: number): Error0GeneralProps[];
333
+ _getCausesPropsFromError0Props(error0Props: Error0GeneralProps, maxLevel: number): Error0GeneralProps[];
334
+ _getClosestPropValue<TPropKey extends keyof Error0GeneralProps>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]> | undefined;
335
+ _getFilledPropValues<TPropKey extends keyof Error0Input>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]>[];
336
+ _getMergedMetaValue(causesProps: Error0GeneralProps[]): Meta0.ValueType;
337
+ _removeConstructorStackPart(stack: Error0GeneralProps["stack"]): Error0GeneralProps["stack"];
338
+ _mergeStack(prevStack: Error0GeneralProps["stack"], nextStack: Error0GeneralProps["stack"]): Error0GeneralProps["stack"];
339
+ isError0(error: unknown): error is Error0;
340
+ isLikelyError0(error: unknown): error is Error0;
341
+ _toError0(error: unknown, inputOverride?: Error0Input): Error0;
342
+ from(error: unknown, inputOverride?: Error0Input): Error0;
343
+ extend(props: {
344
+ defaultMessage?: Error0GeneralProps["message"];
345
+ defaultCode?: Error0GeneralProps["code"];
346
+ defaultHttpStatus?: Error0GeneralProps["httpStatus"];
347
+ defaultExpected?: Error0GeneralProps["expected"];
348
+ defaultClientMessage?: Error0GeneralProps["clientMessage"];
349
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
350
+ }): /*elided*/ any;
351
+ extendCollection<T extends Record<string, typeof Error0>>(classes: T, props: {
352
+ defaultMessage?: Error0GeneralProps["message"];
353
+ defaultCode?: Error0GeneralProps["code"];
354
+ defaultHttpStatus?: Error0GeneralProps["httpStatus"];
355
+ defaultExpected?: Error0GeneralProps["expected"];
356
+ defaultClientMessage?: Error0GeneralProps["clientMessage"];
357
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
358
+ }): T;
359
+ toJSON(error: unknown, inputOverride?: Error0Input): {
360
+ message: string;
361
+ tag: string | undefined;
362
+ code: string | undefined;
363
+ httpStatus: number | undefined;
364
+ expected: boolean | undefined;
365
+ clientMessage: string | undefined;
366
+ anyMessage: string | undefined;
367
+ cause: unknown;
368
+ meta: Meta0.ValueType;
369
+ stack: string | undefined;
370
+ __I_AM_ERROR_0: true;
371
+ };
372
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
373
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
374
+ stackTraceLimit: number;
375
+ };
376
+ static extendCollection<T extends Record<string, typeof Error0>>(classes: T, props: {
377
+ defaultMessage?: Error0GeneralProps['message'];
378
+ defaultCode?: Error0GeneralProps['code'];
379
+ defaultHttpStatus?: Error0GeneralProps['httpStatus'];
380
+ defaultExpected?: Error0GeneralProps['expected'];
381
+ defaultClientMessage?: Error0GeneralProps['clientMessage'];
382
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
383
+ }): T;
384
+ toJSON(): {
385
+ message: string;
386
+ tag: string | undefined;
387
+ code: string | undefined;
388
+ httpStatus: number | undefined;
389
+ expected: boolean | undefined;
390
+ clientMessage: string | undefined;
391
+ anyMessage: string | undefined;
392
+ cause: unknown;
393
+ meta: Meta0.ValueType;
394
+ stack: string | undefined;
395
+ __I_AM_ERROR_0: true;
396
+ };
397
+ static toJSON(error: unknown, inputOverride?: Error0Input): {
398
+ message: string;
399
+ tag: string | undefined;
400
+ code: string | undefined;
401
+ httpStatus: number | undefined;
402
+ expected: boolean | undefined;
403
+ clientMessage: string | undefined;
404
+ anyMessage: string | undefined;
405
+ cause: unknown;
406
+ meta: Meta0.ValueType;
407
+ stack: string | undefined;
408
+ __I_AM_ERROR_0: true;
409
+ };
410
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
411
+ }
412
+ declare namespace Error0 {
413
+ type JSON = ReturnType<Error0['toJSON']>;
414
+ type Collection = Record<string, typeof Error0>;
415
+ }
416
+ declare const e0s: {
417
+ Default: typeof Error0;
418
+ Expected: {
419
+ new (message: string): {
420
+ readonly __I_AM_ERROR_0: true;
421
+ readonly tag?: Error0GeneralProps["tag"];
422
+ readonly code?: Error0GeneralProps["code"];
423
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
424
+ readonly expected?: Error0GeneralProps["expected"];
425
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
426
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
427
+ readonly cause?: Error0GeneralProps["cause"];
428
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
429
+ readonly zodError?: Error0GeneralProps["zodError"];
430
+ readonly axiosError?: Error0GeneralProps["axiosError"];
431
+ readonly propsOriginal: Error0GeneralProps;
432
+ toJSON(): {
433
+ message: string;
434
+ tag: string | undefined;
435
+ code: string | undefined;
436
+ httpStatus: number | undefined;
437
+ expected: boolean | undefined;
438
+ clientMessage: string | undefined;
439
+ anyMessage: string | undefined;
440
+ cause: unknown;
441
+ meta: Meta0.ValueType;
442
+ stack: string | undefined;
443
+ __I_AM_ERROR_0: true;
444
+ };
445
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
446
+ name: string;
447
+ message: string;
448
+ stack?: string;
449
+ };
450
+ new (input: Error0Input): {
451
+ readonly __I_AM_ERROR_0: true;
452
+ readonly tag?: Error0GeneralProps["tag"];
453
+ readonly code?: Error0GeneralProps["code"];
454
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
455
+ readonly expected?: Error0GeneralProps["expected"];
456
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
457
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
458
+ readonly cause?: Error0GeneralProps["cause"];
459
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
460
+ readonly zodError?: Error0GeneralProps["zodError"];
461
+ readonly axiosError?: Error0GeneralProps["axiosError"];
462
+ readonly propsOriginal: Error0GeneralProps;
463
+ toJSON(): {
464
+ message: string;
465
+ tag: string | undefined;
466
+ code: string | undefined;
467
+ httpStatus: number | undefined;
468
+ expected: boolean | undefined;
469
+ clientMessage: string | undefined;
470
+ anyMessage: string | undefined;
471
+ cause: unknown;
472
+ meta: Meta0.ValueType;
473
+ stack: string | undefined;
474
+ __I_AM_ERROR_0: true;
475
+ };
476
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
477
+ name: string;
478
+ message: string;
479
+ stack?: string;
480
+ };
481
+ new (message: string, input: Error0Input): {
482
+ readonly __I_AM_ERROR_0: true;
483
+ readonly tag?: Error0GeneralProps["tag"];
484
+ readonly code?: Error0GeneralProps["code"];
485
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
486
+ readonly expected?: Error0GeneralProps["expected"];
487
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
488
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
489
+ readonly cause?: Error0GeneralProps["cause"];
490
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
491
+ readonly zodError?: Error0GeneralProps["zodError"];
492
+ readonly axiosError?: Error0GeneralProps["axiosError"];
493
+ readonly propsOriginal: Error0GeneralProps;
494
+ toJSON(): {
495
+ message: string;
496
+ tag: string | undefined;
497
+ code: string | undefined;
498
+ httpStatus: number | undefined;
499
+ expected: boolean | undefined;
500
+ clientMessage: string | undefined;
501
+ anyMessage: string | undefined;
502
+ cause: unknown;
503
+ meta: Meta0.ValueType;
504
+ stack: string | undefined;
505
+ __I_AM_ERROR_0: true;
506
+ };
507
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
508
+ name: string;
509
+ message: string;
510
+ stack?: string;
511
+ };
512
+ new (error: Error): {
513
+ readonly __I_AM_ERROR_0: true;
514
+ readonly tag?: Error0GeneralProps["tag"];
515
+ readonly code?: Error0GeneralProps["code"];
516
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
517
+ readonly expected?: Error0GeneralProps["expected"];
518
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
519
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
520
+ readonly cause?: Error0GeneralProps["cause"];
521
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
522
+ readonly zodError?: Error0GeneralProps["zodError"];
523
+ readonly axiosError?: Error0GeneralProps["axiosError"];
524
+ readonly propsOriginal: Error0GeneralProps;
525
+ toJSON(): {
526
+ message: string;
527
+ tag: string | undefined;
528
+ code: string | undefined;
529
+ httpStatus: number | undefined;
530
+ expected: boolean | undefined;
531
+ clientMessage: string | undefined;
532
+ anyMessage: string | undefined;
533
+ cause: unknown;
534
+ meta: Meta0.ValueType;
535
+ stack: string | undefined;
536
+ __I_AM_ERROR_0: true;
537
+ };
538
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
539
+ name: string;
540
+ message: string;
541
+ stack?: string;
542
+ };
543
+ new (error: Error, input: Error0Input): {
544
+ readonly __I_AM_ERROR_0: true;
545
+ readonly tag?: Error0GeneralProps["tag"];
546
+ readonly code?: Error0GeneralProps["code"];
547
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
548
+ readonly expected?: Error0GeneralProps["expected"];
549
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
550
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
551
+ readonly cause?: Error0GeneralProps["cause"];
552
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
553
+ readonly zodError?: Error0GeneralProps["zodError"];
554
+ readonly axiosError?: Error0GeneralProps["axiosError"];
555
+ readonly propsOriginal: Error0GeneralProps;
556
+ toJSON(): {
557
+ message: string;
558
+ tag: string | undefined;
559
+ code: string | undefined;
560
+ httpStatus: number | undefined;
561
+ expected: boolean | undefined;
562
+ clientMessage: string | undefined;
563
+ anyMessage: string | undefined;
564
+ cause: unknown;
565
+ meta: Meta0.ValueType;
566
+ stack: string | undefined;
567
+ __I_AM_ERROR_0: true;
568
+ };
569
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
570
+ name: string;
571
+ message: string;
572
+ stack?: string;
573
+ };
574
+ new (value: unknown): {
575
+ readonly __I_AM_ERROR_0: true;
576
+ readonly tag?: Error0GeneralProps["tag"];
577
+ readonly code?: Error0GeneralProps["code"];
578
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
579
+ readonly expected?: Error0GeneralProps["expected"];
580
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
581
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
582
+ readonly cause?: Error0GeneralProps["cause"];
583
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
584
+ readonly zodError?: Error0GeneralProps["zodError"];
585
+ readonly axiosError?: Error0GeneralProps["axiosError"];
586
+ readonly propsOriginal: Error0GeneralProps;
587
+ toJSON(): {
588
+ message: string;
589
+ tag: string | undefined;
590
+ code: string | undefined;
591
+ httpStatus: number | undefined;
592
+ expected: boolean | undefined;
593
+ clientMessage: string | undefined;
594
+ anyMessage: string | undefined;
595
+ cause: unknown;
596
+ meta: Meta0.ValueType;
597
+ stack: string | undefined;
598
+ __I_AM_ERROR_0: true;
599
+ };
600
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
601
+ name: string;
602
+ message: string;
603
+ stack?: string;
604
+ };
605
+ new (value: unknown, input: Error0Input): {
606
+ readonly __I_AM_ERROR_0: true;
607
+ readonly tag?: Error0GeneralProps["tag"];
608
+ readonly code?: Error0GeneralProps["code"];
609
+ readonly httpStatus?: Error0GeneralProps["httpStatus"];
610
+ readonly expected?: Error0GeneralProps["expected"];
611
+ readonly clientMessage?: Error0GeneralProps["clientMessage"];
612
+ readonly anyMessage?: Error0GeneralProps["anyMessage"];
613
+ readonly cause?: Error0GeneralProps["cause"];
614
+ readonly meta?: Meta0.Meta0OrValueTypeNullish;
615
+ readonly zodError?: Error0GeneralProps["zodError"];
616
+ readonly axiosError?: Error0GeneralProps["axiosError"];
617
+ readonly propsOriginal: Error0GeneralProps;
618
+ toJSON(): {
619
+ message: string;
620
+ tag: string | undefined;
621
+ code: string | undefined;
622
+ httpStatus: number | undefined;
623
+ expected: boolean | undefined;
624
+ clientMessage: string | undefined;
625
+ anyMessage: string | undefined;
626
+ cause: unknown;
627
+ meta: Meta0.ValueType;
628
+ stack: string | undefined;
629
+ __I_AM_ERROR_0: true;
630
+ };
631
+ toResponse(data?: Record<string, unknown>): undici_types.Response;
632
+ name: string;
633
+ message: string;
634
+ stack?: string;
635
+ };
636
+ defaultMessage: string;
637
+ defaultCode: string | undefined;
638
+ defaultHttpStatus: number | undefined;
639
+ defaultExpected: boolean | undefined;
640
+ defaultClientMessage: string | undefined;
641
+ defaultMeta: Meta0;
642
+ defaultMaxLevel: number;
643
+ _safeParseInput(error0Input: Record<string, unknown>): Error0Input;
644
+ _getSelfGeneralProps({ error0Input, message, stack, }: {
645
+ error0Input: Error0Input;
646
+ message: string;
647
+ stack: Error0GeneralProps["stack"];
648
+ }): Error0GeneralProps;
649
+ _getSelfPropsFloated(causesProps: Error0GeneralProps[]): Error0GeneralProps;
650
+ _getExtraError0PropsByZodError(zodError: ZodError): Partial<Error0GeneralProps>;
651
+ _getExtraError0PropsByAxiosError(axiosError: AxiosError): Partial<Error0GeneralProps>;
652
+ _assignError0Props(error0Props: Error0GeneralProps, extraError0Props: Partial<Error0GeneralProps>): void;
653
+ _normalizeSelfExpected(error0Props: Error0GeneralProps, expectedProvided: Error0Input["expected"]): boolean | undefined;
654
+ _isExpected(causesProps: Error0GeneralProps[]): boolean;
655
+ _getPropsFromUnknown(error: unknown, defaults?: Error0Input): Error0GeneralProps;
656
+ _getCausesPropsFromUnknown(error: unknown, maxLevel: number): Error0GeneralProps[];
657
+ _getCausesPropsFromError0Props(error0Props: Error0GeneralProps, maxLevel: number): Error0GeneralProps[];
658
+ _getClosestPropValue<TPropKey extends keyof Error0GeneralProps>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]> | undefined;
659
+ _getFilledPropValues<TPropKey extends keyof Error0Input>(causesProps: Error0GeneralProps[], propKey: TPropKey): NonNullable<Error0GeneralProps[TPropKey]>[];
660
+ _getMergedMetaValue(causesProps: Error0GeneralProps[]): Meta0.ValueType;
661
+ _removeConstructorStackPart(stack: Error0GeneralProps["stack"]): Error0GeneralProps["stack"];
662
+ _mergeStack(prevStack: Error0GeneralProps["stack"], nextStack: Error0GeneralProps["stack"]): Error0GeneralProps["stack"];
663
+ isError0(error: unknown): error is Error0;
664
+ isLikelyError0(error: unknown): error is Error0;
665
+ _toError0(error: unknown, inputOverride?: Error0Input): Error0;
666
+ from(error: unknown, inputOverride?: Error0Input): Error0;
667
+ extend(props: {
668
+ defaultMessage?: Error0GeneralProps["message"];
669
+ defaultCode?: Error0GeneralProps["code"];
670
+ defaultHttpStatus?: Error0GeneralProps["httpStatus"];
671
+ defaultExpected?: Error0GeneralProps["expected"];
672
+ defaultClientMessage?: Error0GeneralProps["clientMessage"];
673
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
674
+ }): /*elided*/ any;
675
+ extendCollection<T extends Record<string, typeof Error0>>(classes: T, props: {
676
+ defaultMessage?: Error0GeneralProps["message"];
677
+ defaultCode?: Error0GeneralProps["code"];
678
+ defaultHttpStatus?: Error0GeneralProps["httpStatus"];
679
+ defaultExpected?: Error0GeneralProps["expected"];
680
+ defaultClientMessage?: Error0GeneralProps["clientMessage"];
681
+ defaultMeta?: Meta0.Meta0OrValueTypeNullish;
682
+ }): T;
683
+ toJSON(error: unknown, inputOverride?: Error0Input): {
684
+ message: string;
685
+ tag: string | undefined;
686
+ code: string | undefined;
687
+ httpStatus: number | undefined;
688
+ expected: boolean | undefined;
689
+ clientMessage: string | undefined;
690
+ anyMessage: string | undefined;
691
+ cause: unknown;
692
+ meta: Meta0.ValueType;
693
+ stack: string | undefined;
694
+ __I_AM_ERROR_0: true;
695
+ };
696
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
697
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
698
+ stackTraceLimit: number;
699
+ };
700
+ };
701
+
702
+ export { Error0, type Error0Input, e0s };