@dxos/errors 0.8.4-main.f9ba587 → 0.8.4-main.fffef41

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