@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.
@@ -1,51 +1,47 @@
1
1
  import { BaseError } from './base';
2
2
  declare const ApiError_base: {
3
3
  new (options?: import("./base").BaseErrorOptions): {
4
- #code: "API";
5
- #context: Record<string, unknown>;
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">): (error: unknown) => {
17
- #code: "API";
18
- #context: Record<string, unknown>;
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
- #code: Code;
30
- #context: Record<string, unknown>;
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">): (error: unknown) => {
42
- #code: Code;
43
- #context: Record<string, unknown>;
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
- #code: "SYSTEM";
68
- #context: Record<string, unknown>;
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">): (error: unknown) => {
80
- #code: "SYSTEM";
81
- #context: Record<string, unknown>;
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
- #code: Code;
93
- #context: Record<string, unknown>;
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">): (error: unknown) => {
105
- #code: Code;
106
- #context: Record<string, unknown>;
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
- #code: "INTERNAL";
131
- #context: Record<string, unknown>;
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">): (error: unknown) => {
143
- #code: "INTERNAL";
144
- #context: Record<string, unknown>;
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
- #code: Code;
156
- #context: Record<string, unknown>;
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">): (error: unknown) => {
168
- #code: Code;
169
- #context: Record<string, unknown>;
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
- #code: "TIMEOUT";
194
- #context: Record<string, unknown>;
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">): (error: unknown) => {
206
- #code: "TIMEOUT";
207
- #context: Record<string, unknown>;
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
- #code: Code;
219
- #context: Record<string, unknown>;
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">): (error: unknown) => {
231
- #code: Code;
232
- #context: Record<string, unknown>;
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
- #code: "ABORTED";
257
- #context: Record<string, unknown>;
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">): (error: unknown) => {
269
- #code: "ABORTED";
270
- #context: Record<string, unknown>;
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
- #code: Code;
282
- #context: Record<string, unknown>;
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">): (error: unknown) => {
294
- #code: Code;
295
- #context: Record<string, unknown>;
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
- #code: "NOT_IMPLEMENTED";
320
- #context: Record<string, unknown>;
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">): (error: unknown) => {
332
- #code: "NOT_IMPLEMENTED";
333
- #context: Record<string, unknown>;
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
- #code: Code;
345
- #context: Record<string, unknown>;
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">): (error: unknown) => {
357
- #code: Code;
358
- #context: Record<string, unknown>;
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;;;;;;;;;;;;;;;uEAakZ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;2EAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAXnc,qBAAa,QAAS,SAAQ,aAAoC;CAAG;;;;;;;;;;;;;;;uEAWgX,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;2EA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