@dxos/errors 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe
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.
- package/dist/lib/browser/index.mjs +29 -85
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +29 -85
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/base.d.ts +9 -12
- package/dist/types/src/base.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +84 -108
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/base.ts +20 -17
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
import { BaseError } from './base';
|
|
2
2
|
declare const ApiError_base: {
|
|
3
3
|
new (options?: import("./base").BaseErrorOptions): {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
code: "API";
|
|
5
|
+
context: Record<string, unknown>;
|
|
6
6
|
get name(): "API";
|
|
7
7
|
get message(): string;
|
|
8
|
-
get code(): "API";
|
|
9
8
|
get _tag(): "API";
|
|
10
|
-
get context(): Record<string, unknown>;
|
|
11
9
|
stack?: string;
|
|
12
10
|
cause?: unknown;
|
|
13
11
|
};
|
|
14
12
|
code: "API";
|
|
15
13
|
is(error: unknown): error is BaseError;
|
|
16
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
15
|
+
ifTypeDiffers?: boolean;
|
|
16
|
+
}) | undefined): (error: unknown) => {
|
|
17
|
+
code: "API";
|
|
18
|
+
context: Record<string, unknown>;
|
|
19
19
|
get name(): "API";
|
|
20
20
|
get message(): string;
|
|
21
|
-
get code(): "API";
|
|
22
21
|
get _tag(): "API";
|
|
23
|
-
get context(): Record<string, unknown>;
|
|
24
22
|
stack?: string;
|
|
25
23
|
cause?: unknown;
|
|
26
24
|
};
|
|
27
25
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
28
26
|
new (options?: import("./base").BaseErrorOptions): {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
code: Code;
|
|
28
|
+
context: Record<string, unknown>;
|
|
31
29
|
get name(): Code;
|
|
32
30
|
get message(): string;
|
|
33
|
-
get code(): Code;
|
|
34
31
|
get _tag(): Code;
|
|
35
|
-
get context(): Record<string, unknown>;
|
|
36
32
|
stack?: string;
|
|
37
33
|
cause?: unknown;
|
|
38
34
|
};
|
|
39
35
|
code: Code;
|
|
40
36
|
is(error: unknown): error is BaseError;
|
|
41
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
38
|
+
ifTypeDiffers?: boolean;
|
|
39
|
+
}): (error: unknown) => {
|
|
40
|
+
code: Code;
|
|
41
|
+
context: Record<string, unknown>;
|
|
44
42
|
get name(): Code;
|
|
45
43
|
get message(): string;
|
|
46
|
-
get code(): Code;
|
|
47
44
|
get _tag(): Code;
|
|
48
|
-
get context(): Record<string, unknown>;
|
|
49
45
|
stack?: string;
|
|
50
46
|
cause?: unknown;
|
|
51
47
|
};
|
|
@@ -64,51 +60,47 @@ export declare class ApiError extends ApiError_base {
|
|
|
64
60
|
}
|
|
65
61
|
declare const SystemError_base: {
|
|
66
62
|
new (options?: import("./base").BaseErrorOptions): {
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
code: "SYSTEM";
|
|
64
|
+
context: Record<string, unknown>;
|
|
69
65
|
get name(): "SYSTEM";
|
|
70
66
|
get message(): string;
|
|
71
|
-
get code(): "SYSTEM";
|
|
72
67
|
get _tag(): "SYSTEM";
|
|
73
|
-
get context(): Record<string, unknown>;
|
|
74
68
|
stack?: string;
|
|
75
69
|
cause?: unknown;
|
|
76
70
|
};
|
|
77
71
|
code: "SYSTEM";
|
|
78
72
|
is(error: unknown): error is BaseError;
|
|
79
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
74
|
+
ifTypeDiffers?: boolean;
|
|
75
|
+
}) | undefined): (error: unknown) => {
|
|
76
|
+
code: "SYSTEM";
|
|
77
|
+
context: Record<string, unknown>;
|
|
82
78
|
get name(): "SYSTEM";
|
|
83
79
|
get message(): string;
|
|
84
|
-
get code(): "SYSTEM";
|
|
85
80
|
get _tag(): "SYSTEM";
|
|
86
|
-
get context(): Record<string, unknown>;
|
|
87
81
|
stack?: string;
|
|
88
82
|
cause?: unknown;
|
|
89
83
|
};
|
|
90
84
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
91
85
|
new (options?: import("./base").BaseErrorOptions): {
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
code: Code;
|
|
87
|
+
context: Record<string, unknown>;
|
|
94
88
|
get name(): Code;
|
|
95
89
|
get message(): string;
|
|
96
|
-
get code(): Code;
|
|
97
90
|
get _tag(): Code;
|
|
98
|
-
get context(): Record<string, unknown>;
|
|
99
91
|
stack?: string;
|
|
100
92
|
cause?: unknown;
|
|
101
93
|
};
|
|
102
94
|
code: Code;
|
|
103
95
|
is(error: unknown): error is BaseError;
|
|
104
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
97
|
+
ifTypeDiffers?: boolean;
|
|
98
|
+
}): (error: unknown) => {
|
|
99
|
+
code: Code;
|
|
100
|
+
context: Record<string, unknown>;
|
|
107
101
|
get name(): Code;
|
|
108
102
|
get message(): string;
|
|
109
|
-
get code(): Code;
|
|
110
103
|
get _tag(): Code;
|
|
111
|
-
get context(): Record<string, unknown>;
|
|
112
104
|
stack?: string;
|
|
113
105
|
cause?: unknown;
|
|
114
106
|
};
|
|
@@ -127,51 +119,47 @@ export declare class SystemError extends SystemError_base {
|
|
|
127
119
|
}
|
|
128
120
|
declare const InternalError_base: {
|
|
129
121
|
new (options?: import("./base").BaseErrorOptions): {
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
code: "INTERNAL";
|
|
123
|
+
context: Record<string, unknown>;
|
|
132
124
|
get name(): "INTERNAL";
|
|
133
125
|
get message(): string;
|
|
134
|
-
get code(): "INTERNAL";
|
|
135
126
|
get _tag(): "INTERNAL";
|
|
136
|
-
get context(): Record<string, unknown>;
|
|
137
127
|
stack?: string;
|
|
138
128
|
cause?: unknown;
|
|
139
129
|
};
|
|
140
130
|
code: "INTERNAL";
|
|
141
131
|
is(error: unknown): error is BaseError;
|
|
142
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
143
|
-
|
|
144
|
-
|
|
132
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
133
|
+
ifTypeDiffers?: boolean;
|
|
134
|
+
}) | undefined): (error: unknown) => {
|
|
135
|
+
code: "INTERNAL";
|
|
136
|
+
context: Record<string, unknown>;
|
|
145
137
|
get name(): "INTERNAL";
|
|
146
138
|
get message(): string;
|
|
147
|
-
get code(): "INTERNAL";
|
|
148
139
|
get _tag(): "INTERNAL";
|
|
149
|
-
get context(): Record<string, unknown>;
|
|
150
140
|
stack?: string;
|
|
151
141
|
cause?: unknown;
|
|
152
142
|
};
|
|
153
143
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
154
144
|
new (options?: import("./base").BaseErrorOptions): {
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
code: Code;
|
|
146
|
+
context: Record<string, unknown>;
|
|
157
147
|
get name(): Code;
|
|
158
148
|
get message(): string;
|
|
159
|
-
get code(): Code;
|
|
160
149
|
get _tag(): Code;
|
|
161
|
-
get context(): Record<string, unknown>;
|
|
162
150
|
stack?: string;
|
|
163
151
|
cause?: unknown;
|
|
164
152
|
};
|
|
165
153
|
code: Code;
|
|
166
154
|
is(error: unknown): error is BaseError;
|
|
167
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
168
|
-
|
|
169
|
-
|
|
155
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
156
|
+
ifTypeDiffers?: boolean;
|
|
157
|
+
}): (error: unknown) => {
|
|
158
|
+
code: Code;
|
|
159
|
+
context: Record<string, unknown>;
|
|
170
160
|
get name(): Code;
|
|
171
161
|
get message(): string;
|
|
172
|
-
get code(): Code;
|
|
173
162
|
get _tag(): Code;
|
|
174
|
-
get context(): Record<string, unknown>;
|
|
175
163
|
stack?: string;
|
|
176
164
|
cause?: unknown;
|
|
177
165
|
};
|
|
@@ -190,51 +178,47 @@ export declare class InternalError extends InternalError_base {
|
|
|
190
178
|
}
|
|
191
179
|
declare const TimeoutError_base: {
|
|
192
180
|
new (options?: import("./base").BaseErrorOptions): {
|
|
193
|
-
|
|
194
|
-
|
|
181
|
+
code: "TIMEOUT";
|
|
182
|
+
context: Record<string, unknown>;
|
|
195
183
|
get name(): "TIMEOUT";
|
|
196
184
|
get message(): string;
|
|
197
|
-
get code(): "TIMEOUT";
|
|
198
185
|
get _tag(): "TIMEOUT";
|
|
199
|
-
get context(): Record<string, unknown>;
|
|
200
186
|
stack?: string;
|
|
201
187
|
cause?: unknown;
|
|
202
188
|
};
|
|
203
189
|
code: "TIMEOUT";
|
|
204
190
|
is(error: unknown): error is BaseError;
|
|
205
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
206
|
-
|
|
207
|
-
|
|
191
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
192
|
+
ifTypeDiffers?: boolean;
|
|
193
|
+
}) | undefined): (error: unknown) => {
|
|
194
|
+
code: "TIMEOUT";
|
|
195
|
+
context: Record<string, unknown>;
|
|
208
196
|
get name(): "TIMEOUT";
|
|
209
197
|
get message(): string;
|
|
210
|
-
get code(): "TIMEOUT";
|
|
211
198
|
get _tag(): "TIMEOUT";
|
|
212
|
-
get context(): Record<string, unknown>;
|
|
213
199
|
stack?: string;
|
|
214
200
|
cause?: unknown;
|
|
215
201
|
};
|
|
216
202
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
217
203
|
new (options?: import("./base").BaseErrorOptions): {
|
|
218
|
-
|
|
219
|
-
|
|
204
|
+
code: Code;
|
|
205
|
+
context: Record<string, unknown>;
|
|
220
206
|
get name(): Code;
|
|
221
207
|
get message(): string;
|
|
222
|
-
get code(): Code;
|
|
223
208
|
get _tag(): Code;
|
|
224
|
-
get context(): Record<string, unknown>;
|
|
225
209
|
stack?: string;
|
|
226
210
|
cause?: unknown;
|
|
227
211
|
};
|
|
228
212
|
code: Code;
|
|
229
213
|
is(error: unknown): error is BaseError;
|
|
230
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
231
|
-
|
|
232
|
-
|
|
214
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
215
|
+
ifTypeDiffers?: boolean;
|
|
216
|
+
}): (error: unknown) => {
|
|
217
|
+
code: Code;
|
|
218
|
+
context: Record<string, unknown>;
|
|
233
219
|
get name(): Code;
|
|
234
220
|
get message(): string;
|
|
235
|
-
get code(): Code;
|
|
236
221
|
get _tag(): Code;
|
|
237
|
-
get context(): Record<string, unknown>;
|
|
238
222
|
stack?: string;
|
|
239
223
|
cause?: unknown;
|
|
240
224
|
};
|
|
@@ -253,51 +237,47 @@ export declare class TimeoutError extends TimeoutError_base {
|
|
|
253
237
|
}
|
|
254
238
|
declare const AbortedError_base: {
|
|
255
239
|
new (options?: import("./base").BaseErrorOptions): {
|
|
256
|
-
|
|
257
|
-
|
|
240
|
+
code: "ABORTED";
|
|
241
|
+
context: Record<string, unknown>;
|
|
258
242
|
get name(): "ABORTED";
|
|
259
243
|
get message(): string;
|
|
260
|
-
get code(): "ABORTED";
|
|
261
244
|
get _tag(): "ABORTED";
|
|
262
|
-
get context(): Record<string, unknown>;
|
|
263
245
|
stack?: string;
|
|
264
246
|
cause?: unknown;
|
|
265
247
|
};
|
|
266
248
|
code: "ABORTED";
|
|
267
249
|
is(error: unknown): error is BaseError;
|
|
268
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
269
|
-
|
|
270
|
-
|
|
250
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
251
|
+
ifTypeDiffers?: boolean;
|
|
252
|
+
}) | undefined): (error: unknown) => {
|
|
253
|
+
code: "ABORTED";
|
|
254
|
+
context: Record<string, unknown>;
|
|
271
255
|
get name(): "ABORTED";
|
|
272
256
|
get message(): string;
|
|
273
|
-
get code(): "ABORTED";
|
|
274
257
|
get _tag(): "ABORTED";
|
|
275
|
-
get context(): Record<string, unknown>;
|
|
276
258
|
stack?: string;
|
|
277
259
|
cause?: unknown;
|
|
278
260
|
};
|
|
279
261
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
280
262
|
new (options?: import("./base").BaseErrorOptions): {
|
|
281
|
-
|
|
282
|
-
|
|
263
|
+
code: Code;
|
|
264
|
+
context: Record<string, unknown>;
|
|
283
265
|
get name(): Code;
|
|
284
266
|
get message(): string;
|
|
285
|
-
get code(): Code;
|
|
286
267
|
get _tag(): Code;
|
|
287
|
-
get context(): Record<string, unknown>;
|
|
288
268
|
stack?: string;
|
|
289
269
|
cause?: unknown;
|
|
290
270
|
};
|
|
291
271
|
code: Code;
|
|
292
272
|
is(error: unknown): error is BaseError;
|
|
293
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
294
|
-
|
|
295
|
-
|
|
273
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
274
|
+
ifTypeDiffers?: boolean;
|
|
275
|
+
}): (error: unknown) => {
|
|
276
|
+
code: Code;
|
|
277
|
+
context: Record<string, unknown>;
|
|
296
278
|
get name(): Code;
|
|
297
279
|
get message(): string;
|
|
298
|
-
get code(): Code;
|
|
299
280
|
get _tag(): Code;
|
|
300
|
-
get context(): Record<string, unknown>;
|
|
301
281
|
stack?: string;
|
|
302
282
|
cause?: unknown;
|
|
303
283
|
};
|
|
@@ -316,51 +296,47 @@ export declare class AbortedError extends AbortedError_base {
|
|
|
316
296
|
}
|
|
317
297
|
declare const NotImplementedError_base: {
|
|
318
298
|
new (options?: import("./base").BaseErrorOptions): {
|
|
319
|
-
|
|
320
|
-
|
|
299
|
+
code: "NOT_IMPLEMENTED";
|
|
300
|
+
context: Record<string, unknown>;
|
|
321
301
|
get name(): "NOT_IMPLEMENTED";
|
|
322
302
|
get message(): string;
|
|
323
|
-
get code(): "NOT_IMPLEMENTED";
|
|
324
303
|
get _tag(): "NOT_IMPLEMENTED";
|
|
325
|
-
get context(): Record<string, unknown>;
|
|
326
304
|
stack?: string;
|
|
327
305
|
cause?: unknown;
|
|
328
306
|
};
|
|
329
307
|
code: "NOT_IMPLEMENTED";
|
|
330
308
|
is(error: unknown): error is BaseError;
|
|
331
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
332
|
-
|
|
333
|
-
|
|
309
|
+
wrap(options?: (Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
310
|
+
ifTypeDiffers?: boolean;
|
|
311
|
+
}) | undefined): (error: unknown) => {
|
|
312
|
+
code: "NOT_IMPLEMENTED";
|
|
313
|
+
context: Record<string, unknown>;
|
|
334
314
|
get name(): "NOT_IMPLEMENTED";
|
|
335
315
|
get message(): string;
|
|
336
|
-
get code(): "NOT_IMPLEMENTED";
|
|
337
316
|
get _tag(): "NOT_IMPLEMENTED";
|
|
338
|
-
get context(): Record<string, unknown>;
|
|
339
317
|
stack?: string;
|
|
340
318
|
cause?: unknown;
|
|
341
319
|
};
|
|
342
320
|
extend<Code extends string = string>(code: Code, message?: string): {
|
|
343
321
|
new (options?: import("./base").BaseErrorOptions): {
|
|
344
|
-
|
|
345
|
-
|
|
322
|
+
code: Code;
|
|
323
|
+
context: Record<string, unknown>;
|
|
346
324
|
get name(): Code;
|
|
347
325
|
get message(): string;
|
|
348
|
-
get code(): Code;
|
|
349
326
|
get _tag(): Code;
|
|
350
|
-
get context(): Record<string, unknown>;
|
|
351
327
|
stack?: string;
|
|
352
328
|
cause?: unknown;
|
|
353
329
|
};
|
|
354
330
|
code: Code;
|
|
355
331
|
is(error: unknown): error is BaseError;
|
|
356
|
-
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause">
|
|
357
|
-
|
|
358
|
-
|
|
332
|
+
wrap(options?: Omit<import("./base").BaseErrorOptions, "cause"> & {
|
|
333
|
+
ifTypeDiffers?: boolean;
|
|
334
|
+
}): (error: unknown) => {
|
|
335
|
+
code: Code;
|
|
336
|
+
context: Record<string, unknown>;
|
|
359
337
|
get name(): Code;
|
|
360
338
|
get message(): string;
|
|
361
|
-
get code(): Code;
|
|
362
339
|
get _tag(): Code;
|
|
363
|
-
get context(): Record<string, unknown>;
|
|
364
340
|
stack?: string;
|
|
365
341
|
cause?: unknown;
|
|
366
342
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAaua,CAAC;;;;;;;;;;;;;;;;;;;;;AAX3c,qBAAa,QAAS,SAAQ,aAAoC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAWqY,CAAC;;;;;;;;;;;;;;;;;;;;;AAT3c,qBAAa,WAAY,SAAQ,gBAA0C;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAS4X,CAAC;;;;;;;;;;;;;;;;;;;;;AAP3c,qBAAa,aAAc,SAAQ,kBAA8C;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAOsX,CAAC;;;;;;;;;;;;;;;;;;;;;AAL3c,qBAAa,YAAa,SAAQ,iBAAsC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAK+X,CAAC;;;;;;;;;;;;;;;;;;;;;AAH3c,qBAAa,YAAa,SAAQ,iBAAsC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAG+X,CAAC;;;;;;;;;;;;;;;;;;;;;AAD3c,qBAAa,mBAAoB,SAAQ,wBAAsD;CAAG"}
|