@dxos/errors 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d

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,18 +1,61 @@
1
1
  import { BaseError } from './base';
2
2
  declare const TimeoutError_base: {
3
3
  new (message: string, options?: import("./base").BaseErrorOptions): {
4
- "__#1@#code": string;
5
- "__#1@#context": Record<string, unknown>;
6
- readonly name: string;
7
- readonly code: string;
8
- readonly context: Record<string, unknown>;
4
+ #code: "TIMEOUT";
5
+ #context: Record<string, unknown>;
6
+ get name(): "TIMEOUT";
7
+ get code(): "TIMEOUT";
8
+ get _tag(): "TIMEOUT";
9
+ get context(): Record<string, unknown>;
9
10
  message: string;
10
11
  stack?: string;
11
12
  cause?: unknown;
12
13
  };
13
- code: string;
14
+ code: "TIMEOUT";
14
15
  is(error: unknown): error is BaseError;
15
- extend(code: string): /*elided*/ any;
16
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
17
+ #code: "TIMEOUT";
18
+ #context: Record<string, unknown>;
19
+ get name(): "TIMEOUT";
20
+ get code(): "TIMEOUT";
21
+ get _tag(): "TIMEOUT";
22
+ get context(): Record<string, unknown>;
23
+ message: string;
24
+ stack?: string;
25
+ cause?: unknown;
26
+ };
27
+ extend<Code extends string>(code: Code): {
28
+ new (message: string, options?: import("./base").BaseErrorOptions): {
29
+ #code: Code;
30
+ #context: Record<string, unknown>;
31
+ get name(): Code;
32
+ get code(): Code;
33
+ get _tag(): Code;
34
+ get context(): Record<string, unknown>;
35
+ message: string;
36
+ stack?: string;
37
+ cause?: unknown;
38
+ };
39
+ code: Code;
40
+ is(error: unknown): error is BaseError;
41
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
42
+ #code: Code;
43
+ #context: Record<string, unknown>;
44
+ get name(): Code;
45
+ get code(): Code;
46
+ get _tag(): Code;
47
+ get context(): Record<string, unknown>;
48
+ message: string;
49
+ stack?: string;
50
+ cause?: unknown;
51
+ };
52
+ extend<Code extends string>(code: Code): /*elided*/ any;
53
+ isError(error: unknown): error is Error;
54
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
55
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
56
+ stackTraceLimit: number;
57
+ };
58
+ isError(error: unknown): error is Error;
16
59
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
17
60
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
18
61
  stackTraceLimit: number;
@@ -21,18 +64,61 @@ export declare class TimeoutError extends TimeoutError_base {
21
64
  }
22
65
  declare const AbortedError_base: {
23
66
  new (message: string, options?: import("./base").BaseErrorOptions): {
24
- "__#1@#code": string;
25
- "__#1@#context": Record<string, unknown>;
26
- readonly name: string;
27
- readonly code: string;
28
- readonly context: Record<string, unknown>;
67
+ #code: "ABORTED";
68
+ #context: Record<string, unknown>;
69
+ get name(): "ABORTED";
70
+ get code(): "ABORTED";
71
+ get _tag(): "ABORTED";
72
+ get context(): Record<string, unknown>;
29
73
  message: string;
30
74
  stack?: string;
31
75
  cause?: unknown;
32
76
  };
33
- code: string;
77
+ code: "ABORTED";
34
78
  is(error: unknown): error is BaseError;
35
- extend(code: string): /*elided*/ any;
79
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
80
+ #code: "ABORTED";
81
+ #context: Record<string, unknown>;
82
+ get name(): "ABORTED";
83
+ get code(): "ABORTED";
84
+ get _tag(): "ABORTED";
85
+ get context(): Record<string, unknown>;
86
+ message: string;
87
+ stack?: string;
88
+ cause?: unknown;
89
+ };
90
+ extend<Code extends string>(code: Code): {
91
+ new (message: string, options?: import("./base").BaseErrorOptions): {
92
+ #code: Code;
93
+ #context: Record<string, unknown>;
94
+ get name(): Code;
95
+ get code(): Code;
96
+ get _tag(): Code;
97
+ get context(): Record<string, unknown>;
98
+ message: string;
99
+ stack?: string;
100
+ cause?: unknown;
101
+ };
102
+ code: Code;
103
+ is(error: unknown): error is BaseError;
104
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
105
+ #code: Code;
106
+ #context: Record<string, unknown>;
107
+ get name(): Code;
108
+ get code(): Code;
109
+ get _tag(): Code;
110
+ get context(): Record<string, unknown>;
111
+ message: string;
112
+ stack?: string;
113
+ cause?: unknown;
114
+ };
115
+ extend<Code extends string>(code: Code): /*elided*/ any;
116
+ isError(error: unknown): error is Error;
117
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
118
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
119
+ stackTraceLimit: number;
120
+ };
121
+ isError(error: unknown): error is Error;
36
122
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
37
123
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
38
124
  stackTraceLimit: number;
@@ -41,18 +127,61 @@ export declare class AbortedError extends AbortedError_base {
41
127
  }
42
128
  declare const UnimplementedError_base: {
43
129
  new (message: string, options?: import("./base").BaseErrorOptions): {
44
- "__#1@#code": string;
45
- "__#1@#context": Record<string, unknown>;
46
- readonly name: string;
47
- readonly code: string;
48
- readonly context: Record<string, unknown>;
130
+ #code: "UNIMPLEMENTED";
131
+ #context: Record<string, unknown>;
132
+ get name(): "UNIMPLEMENTED";
133
+ get code(): "UNIMPLEMENTED";
134
+ get _tag(): "UNIMPLEMENTED";
135
+ get context(): Record<string, unknown>;
49
136
  message: string;
50
137
  stack?: string;
51
138
  cause?: unknown;
52
139
  };
53
- code: string;
140
+ code: "UNIMPLEMENTED";
54
141
  is(error: unknown): error is BaseError;
55
- extend(code: string): /*elided*/ any;
142
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
143
+ #code: "UNIMPLEMENTED";
144
+ #context: Record<string, unknown>;
145
+ get name(): "UNIMPLEMENTED";
146
+ get code(): "UNIMPLEMENTED";
147
+ get _tag(): "UNIMPLEMENTED";
148
+ get context(): Record<string, unknown>;
149
+ message: string;
150
+ stack?: string;
151
+ cause?: unknown;
152
+ };
153
+ extend<Code extends string>(code: Code): {
154
+ new (message: string, options?: import("./base").BaseErrorOptions): {
155
+ #code: Code;
156
+ #context: Record<string, unknown>;
157
+ get name(): Code;
158
+ get code(): Code;
159
+ get _tag(): Code;
160
+ get context(): Record<string, unknown>;
161
+ message: string;
162
+ stack?: string;
163
+ cause?: unknown;
164
+ };
165
+ code: Code;
166
+ is(error: unknown): error is BaseError;
167
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
168
+ #code: Code;
169
+ #context: Record<string, unknown>;
170
+ get name(): Code;
171
+ get code(): Code;
172
+ get _tag(): Code;
173
+ get context(): Record<string, unknown>;
174
+ message: string;
175
+ stack?: string;
176
+ cause?: unknown;
177
+ };
178
+ extend<Code extends string>(code: Code): /*elided*/ any;
179
+ isError(error: unknown): error is Error;
180
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
181
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
182
+ stackTraceLimit: number;
183
+ };
184
+ isError(error: unknown): error is Error;
56
185
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
57
186
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
58
187
  stackTraceLimit: number;
@@ -61,18 +190,61 @@ export declare class UnimplementedError extends UnimplementedError_base {
61
190
  }
62
191
  declare const ApiError_base: {
63
192
  new (message: string, options?: import("./base").BaseErrorOptions): {
64
- "__#1@#code": string;
65
- "__#1@#context": Record<string, unknown>;
66
- readonly name: string;
67
- readonly code: string;
68
- readonly context: Record<string, unknown>;
193
+ #code: "API_ERROR";
194
+ #context: Record<string, unknown>;
195
+ get name(): "API_ERROR";
196
+ get code(): "API_ERROR";
197
+ get _tag(): "API_ERROR";
198
+ get context(): Record<string, unknown>;
69
199
  message: string;
70
200
  stack?: string;
71
201
  cause?: unknown;
72
202
  };
73
- code: string;
203
+ code: "API_ERROR";
74
204
  is(error: unknown): error is BaseError;
75
- extend(code: string): /*elided*/ any;
205
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
206
+ #code: "API_ERROR";
207
+ #context: Record<string, unknown>;
208
+ get name(): "API_ERROR";
209
+ get code(): "API_ERROR";
210
+ get _tag(): "API_ERROR";
211
+ get context(): Record<string, unknown>;
212
+ message: string;
213
+ stack?: string;
214
+ cause?: unknown;
215
+ };
216
+ extend<Code extends string>(code: Code): {
217
+ new (message: string, options?: import("./base").BaseErrorOptions): {
218
+ #code: Code;
219
+ #context: Record<string, unknown>;
220
+ get name(): Code;
221
+ get code(): Code;
222
+ get _tag(): Code;
223
+ get context(): Record<string, unknown>;
224
+ message: string;
225
+ stack?: string;
226
+ cause?: unknown;
227
+ };
228
+ code: Code;
229
+ is(error: unknown): error is BaseError;
230
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
231
+ #code: Code;
232
+ #context: Record<string, unknown>;
233
+ get name(): Code;
234
+ get code(): Code;
235
+ get _tag(): Code;
236
+ get context(): Record<string, unknown>;
237
+ message: string;
238
+ stack?: string;
239
+ cause?: unknown;
240
+ };
241
+ extend<Code extends string>(code: Code): /*elided*/ any;
242
+ isError(error: unknown): error is Error;
243
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
244
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
245
+ stackTraceLimit: number;
246
+ };
247
+ isError(error: unknown): error is Error;
76
248
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
77
249
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
78
250
  stackTraceLimit: number;
@@ -81,18 +253,61 @@ export declare class ApiError extends ApiError_base {
81
253
  }
82
254
  declare const SystemError_base: {
83
255
  new (message: string, options?: import("./base").BaseErrorOptions): {
84
- "__#1@#code": string;
85
- "__#1@#context": Record<string, unknown>;
86
- readonly name: string;
87
- readonly code: string;
88
- readonly context: Record<string, unknown>;
256
+ #code: "SYSTEM_ERROR";
257
+ #context: Record<string, unknown>;
258
+ get name(): "SYSTEM_ERROR";
259
+ get code(): "SYSTEM_ERROR";
260
+ get _tag(): "SYSTEM_ERROR";
261
+ get context(): Record<string, unknown>;
89
262
  message: string;
90
263
  stack?: string;
91
264
  cause?: unknown;
92
265
  };
93
- code: string;
266
+ code: "SYSTEM_ERROR";
94
267
  is(error: unknown): error is BaseError;
95
- extend(code: string): /*elided*/ any;
268
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
269
+ #code: "SYSTEM_ERROR";
270
+ #context: Record<string, unknown>;
271
+ get name(): "SYSTEM_ERROR";
272
+ get code(): "SYSTEM_ERROR";
273
+ get _tag(): "SYSTEM_ERROR";
274
+ get context(): Record<string, unknown>;
275
+ message: string;
276
+ stack?: string;
277
+ cause?: unknown;
278
+ };
279
+ extend<Code extends string>(code: Code): {
280
+ new (message: string, options?: import("./base").BaseErrorOptions): {
281
+ #code: Code;
282
+ #context: Record<string, unknown>;
283
+ get name(): Code;
284
+ get code(): Code;
285
+ get _tag(): Code;
286
+ get context(): Record<string, unknown>;
287
+ message: string;
288
+ stack?: string;
289
+ cause?: unknown;
290
+ };
291
+ code: Code;
292
+ is(error: unknown): error is BaseError;
293
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
294
+ #code: Code;
295
+ #context: Record<string, unknown>;
296
+ get name(): Code;
297
+ get code(): Code;
298
+ get _tag(): Code;
299
+ get context(): Record<string, unknown>;
300
+ message: string;
301
+ stack?: string;
302
+ cause?: unknown;
303
+ };
304
+ extend<Code extends string>(code: Code): /*elided*/ any;
305
+ isError(error: unknown): error is Error;
306
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
307
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
308
+ stackTraceLimit: number;
309
+ };
310
+ isError(error: unknown): error is Error;
96
311
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
97
312
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
98
313
  stackTraceLimit: number;
@@ -101,18 +316,61 @@ export declare class SystemError extends SystemError_base {
101
316
  }
102
317
  declare const InternalError_base: {
103
318
  new (message: string, options?: import("./base").BaseErrorOptions): {
104
- "__#1@#code": string;
105
- "__#1@#context": Record<string, unknown>;
106
- readonly name: string;
107
- readonly code: string;
108
- readonly context: Record<string, unknown>;
319
+ #code: "INTERNAL_ERROR";
320
+ #context: Record<string, unknown>;
321
+ get name(): "INTERNAL_ERROR";
322
+ get code(): "INTERNAL_ERROR";
323
+ get _tag(): "INTERNAL_ERROR";
324
+ get context(): Record<string, unknown>;
109
325
  message: string;
110
326
  stack?: string;
111
327
  cause?: unknown;
112
328
  };
113
- code: string;
329
+ code: "INTERNAL_ERROR";
114
330
  is(error: unknown): error is BaseError;
115
- extend(code: string): /*elided*/ any;
331
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
332
+ #code: "INTERNAL_ERROR";
333
+ #context: Record<string, unknown>;
334
+ get name(): "INTERNAL_ERROR";
335
+ get code(): "INTERNAL_ERROR";
336
+ get _tag(): "INTERNAL_ERROR";
337
+ get context(): Record<string, unknown>;
338
+ message: string;
339
+ stack?: string;
340
+ cause?: unknown;
341
+ };
342
+ extend<Code extends string>(code: Code): {
343
+ new (message: string, options?: import("./base").BaseErrorOptions): {
344
+ #code: Code;
345
+ #context: Record<string, unknown>;
346
+ get name(): Code;
347
+ get code(): Code;
348
+ get _tag(): Code;
349
+ get context(): Record<string, unknown>;
350
+ message: string;
351
+ stack?: string;
352
+ cause?: unknown;
353
+ };
354
+ code: Code;
355
+ is(error: unknown): error is BaseError;
356
+ wrap(message: string, options?: Omit<import("./base").BaseErrorOptions, "cause">): (error: unknown) => {
357
+ #code: Code;
358
+ #context: Record<string, unknown>;
359
+ get name(): Code;
360
+ get code(): Code;
361
+ get _tag(): Code;
362
+ get context(): Record<string, unknown>;
363
+ message: string;
364
+ stack?: string;
365
+ cause?: unknown;
366
+ };
367
+ extend<Code extends string>(code: Code): /*elided*/ any;
368
+ isError(error: unknown): error is Error;
369
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
370
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
371
+ stackTraceLimit: number;
372
+ };
373
+ isError(error: unknown): error is Error;
116
374
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
117
375
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
118
376
  stackTraceLimit: number;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;AAEnC,qBAAa,YAAa,SAAQ,iBAA2B;CAAG;;;;;;;;;;;;;;;;;;;AAEhE,qBAAa,YAAa,SAAQ,iBAA2B;CAAG;;;;;;;;;;;;;;;;;;;AAEhE,qBAAa,kBAAmB,SAAQ,uBAAiC;CAAG;;;;;;;;;;;;;;;;;;;AAE5E,qBAAa,QAAS,SAAQ,aAA6B;CAAG;;;;;;;;;;;;;;;;;;;AAE9D,qBAAa,WAAY,SAAQ,gBAAgC;CAAG;;;;;;;;;;;;;;;;;;;AAEpE,qBAAa,aAAc,SAAQ,kBAAkC;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;;;;;;;;;;wFAa6a,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAX9d,qBAAa,YAAa,SAAQ,iBAA2B;CAAG;;;;;;;;;;;;;;;wFAWgZ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAT9d,qBAAa,YAAa,SAAQ,iBAA2B;CAAG;;;;;;;;;;;;;;;wFASgZ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAP9d,qBAAa,kBAAmB,SAAQ,uBAAiC;CAAG;;;;;;;;;;;;;;;wFAOoY,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAL9d,qBAAa,QAAS,SAAQ,aAA6B;CAAG;;;;;;;;;;;;;;;wFAKkZ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAH9d,qBAAa,WAAY,SAAQ,gBAAgC;CAAG;;;;;;;;;;;;;;;wFAG4Y,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;4FAAd,cAAc;;;;;;;;;;;;;;;;;;;;;;AAD9d,qBAAa,aAAc,SAAQ,kBAAkC;CAAG"}