@dxos/errors 0.1.36-next.ef27157 → 0.1.37-next.41339e7
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 +6 -0
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +7 -0
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/errors.d.ts +3 -0
- package/dist/types/src/errors.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -26,9 +26,15 @@ var RemoteServiceConnectionTimeout = class extends ApiError {
|
|
|
26
26
|
super("REMOTE_SERVICE_CONNECTION_TIMEOUT", message, context);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
+
var DataCorruptionError = class extends SystemError {
|
|
30
|
+
constructor(message, context) {
|
|
31
|
+
super("DATA_CORRUPTION", message, context);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
29
34
|
export {
|
|
30
35
|
ApiError,
|
|
31
36
|
CancelledError,
|
|
37
|
+
DataCorruptionError,
|
|
32
38
|
InvalidConfigError,
|
|
33
39
|
RemoteServiceConnectionTimeout,
|
|
34
40
|
SystemError
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/errors.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * NOTE: Messages should be sentences (Start with a capital letter and end with a period).\n * Errors can optionally include a JSON context object.\n */\nclass BaseError extends Error {\n constructor(readonly code: string, message?: string, readonly context?: any) {\n super(message ? `${code}: ${message}` : code.toString());\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * User facing API Errors.\n * E.g., something was misconfigured.\n */\nexport class ApiError extends BaseError {}\n\n/**\n * Internal system errors.\n * E.g., unexpected/unrecoverable runtime error.\n */\nexport class SystemError extends BaseError {}\n\nexport class CancelledError extends SystemError {\n constructor(message?: string, context?: any) {\n super('CANCELLED', message, context);\n }\n}\n\nexport class InvalidConfigError extends ApiError {\n constructor(message: string, context?: any) {\n super('INVALID_CONFIG', message, context);\n }\n}\n\nexport class RemoteServiceConnectionTimeout extends ApiError {\n constructor(message?: string, context?: any) {\n super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAQA,IAAMA,YAAN,cAAwBC,MAAAA;EACtBC,YAAqBC,MAAcC,SAA2BC,SAAe;AAC3E,UAAMD,UAAU,GAAGD,SAASC,YAAYD,KAAKG,SAAQ,CAAE;gBADpCH;mBAAyCE;AAG5DE,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAMO,IAAMC,WAAN,cAAuBV,UAAAA;AAAW;AAMlC,IAAMW,cAAN,cAA0BX,UAAAA;AAAW;AAErC,IAAMY,iBAAN,cAA6BD,YAAAA;EAClCT,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,aAAaD,SAASC,OAAAA;EAC9B;AACF;AAEO,IAAMQ,qBAAN,cAAiCH,SAAAA;EACtCR,YAAYE,SAAiBC,SAAe;AAC1C,UAAM,kBAAkBD,SAASC,OAAAA;EACnC;AACF;AAEO,IAAMS,iCAAN,cAA6CJ,SAAAA;EAClDR,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,qCAAqCD,SAASC,OAAAA;EACtD;AACF;",
|
|
6
|
-
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "CancelledError", "InvalidConfigError", "RemoteServiceConnectionTimeout"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * NOTE: Messages should be sentences (Start with a capital letter and end with a period).\n * Errors can optionally include a JSON context object.\n */\nclass BaseError extends Error {\n constructor(readonly code: string, message?: string, readonly context?: any) {\n super(message ? `${code}: ${message}` : code.toString());\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * User facing API Errors.\n * E.g., something was misconfigured.\n */\nexport class ApiError extends BaseError {}\n\n/**\n * Internal system errors.\n * E.g., unexpected/unrecoverable runtime error.\n */\nexport class SystemError extends BaseError {}\n\nexport class CancelledError extends SystemError {\n constructor(message?: string, context?: any) {\n super('CANCELLED', message, context);\n }\n}\n\nexport class InvalidConfigError extends ApiError {\n constructor(message: string, context?: any) {\n super('INVALID_CONFIG', message, context);\n }\n}\n\nexport class RemoteServiceConnectionTimeout extends ApiError {\n constructor(message?: string, context?: any) {\n super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);\n }\n}\n\nexport class DataCorruptionError extends SystemError {\n constructor(message?: string, context?: any) {\n super('DATA_CORRUPTION', message, context);\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,IAAMA,YAAN,cAAwBC,MAAAA;EACtBC,YAAqBC,MAAcC,SAA2BC,SAAe;AAC3E,UAAMD,UAAU,GAAGD,SAASC,YAAYD,KAAKG,SAAQ,CAAE;gBADpCH;mBAAyCE;AAG5DE,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAMO,IAAMC,WAAN,cAAuBV,UAAAA;AAAW;AAMlC,IAAMW,cAAN,cAA0BX,UAAAA;AAAW;AAErC,IAAMY,iBAAN,cAA6BD,YAAAA;EAClCT,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,aAAaD,SAASC,OAAAA;EAC9B;AACF;AAEO,IAAMQ,qBAAN,cAAiCH,SAAAA;EACtCR,YAAYE,SAAiBC,SAAe;AAC1C,UAAM,kBAAkBD,SAASC,OAAAA;EACnC;AACF;AAEO,IAAMS,iCAAN,cAA6CJ,SAAAA;EAClDR,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,qCAAqCD,SAASC,OAAAA;EACtD;AACF;AAEO,IAAMU,sBAAN,cAAkCJ,YAAAA;EACvCT,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,mBAAmBD,SAASC,OAAAA;EACpC;AACF;",
|
|
6
|
+
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "CancelledError", "InvalidConfigError", "RemoteServiceConnectionTimeout", "DataCorruptionError"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":4823,"imports":[]},"packages/sdk/errors/src/index.ts":{"bytes":370,"imports":[{"path":"packages/sdk/errors/src/errors.ts","kind":"import-statement","original":"./errors"}]}},"outputs":{"packages/sdk/errors/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2438},"packages/sdk/errors/dist/lib/browser/index.mjs":{"imports":[],"exports":["ApiError","CancelledError","DataCorruptionError","InvalidConfigError","RemoteServiceConnectionTimeout","SystemError"],"entryPoint":"packages/sdk/errors/src/index.ts","inputs":{"packages/sdk/errors/src/errors.ts":{"bytesInOutput":925},"packages/sdk/errors/src/index.ts":{"bytesInOutput":0}},"bytes":1132}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
ApiError: () => ApiError,
|
|
24
24
|
CancelledError: () => CancelledError,
|
|
25
|
+
DataCorruptionError: () => DataCorruptionError,
|
|
25
26
|
InvalidConfigError: () => InvalidConfigError,
|
|
26
27
|
RemoteServiceConnectionTimeout: () => RemoteServiceConnectionTimeout,
|
|
27
28
|
SystemError: () => SystemError
|
|
@@ -56,10 +57,16 @@ var RemoteServiceConnectionTimeout = class extends ApiError {
|
|
|
56
57
|
super("REMOTE_SERVICE_CONNECTION_TIMEOUT", message, context);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
var DataCorruptionError = class extends SystemError {
|
|
61
|
+
constructor(message, context) {
|
|
62
|
+
super("DATA_CORRUPTION", message, context);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
59
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
66
|
0 && (module.exports = {
|
|
61
67
|
ApiError,
|
|
62
68
|
CancelledError,
|
|
69
|
+
DataCorruptionError,
|
|
63
70
|
InvalidConfigError,
|
|
64
71
|
RemoteServiceConnectionTimeout,
|
|
65
72
|
SystemError
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts", "../../../src/errors.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nexport * from './errors';\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * NOTE: Messages should be sentences (Start with a capital letter and end with a period).\n * Errors can optionally include a JSON context object.\n */\nclass BaseError extends Error {\n constructor(readonly code: string, message?: string, readonly context?: any) {\n super(message ? `${code}: ${message}` : code.toString());\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * User facing API Errors.\n * E.g., something was misconfigured.\n */\nexport class ApiError extends BaseError {}\n\n/**\n * Internal system errors.\n * E.g., unexpected/unrecoverable runtime error.\n */\nexport class SystemError extends BaseError {}\n\nexport class CancelledError extends SystemError {\n constructor(message?: string, context?: any) {\n super('CANCELLED', message, context);\n }\n}\n\nexport class InvalidConfigError extends ApiError {\n constructor(message: string, context?: any) {\n super('INVALID_CONFIG', message, context);\n }\n}\n\nexport class RemoteServiceConnectionTimeout extends ApiError {\n constructor(message?: string, context?: any) {\n super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA
|
|
6
|
-
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "CancelledError", "InvalidConfigError", "RemoteServiceConnectionTimeout"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nexport * from './errors';\n", "//\n// Copyright 2021 DXOS.org\n//\n\n/**\n * NOTE: Messages should be sentences (Start with a capital letter and end with a period).\n * Errors can optionally include a JSON context object.\n */\nclass BaseError extends Error {\n constructor(readonly code: string, message?: string, readonly context?: any) {\n super(message ? `${code}: ${message}` : code.toString());\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * User facing API Errors.\n * E.g., something was misconfigured.\n */\nexport class ApiError extends BaseError {}\n\n/**\n * Internal system errors.\n * E.g., unexpected/unrecoverable runtime error.\n */\nexport class SystemError extends BaseError {}\n\nexport class CancelledError extends SystemError {\n constructor(message?: string, context?: any) {\n super('CANCELLED', message, context);\n }\n}\n\nexport class InvalidConfigError extends ApiError {\n constructor(message: string, context?: any) {\n super('INVALID_CONFIG', message, context);\n }\n}\n\nexport class RemoteServiceConnectionTimeout extends ApiError {\n constructor(message?: string, context?: any) {\n super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);\n }\n}\n\nexport class DataCorruptionError extends SystemError {\n constructor(message?: string, context?: any) {\n super('DATA_CORRUPTION', message, context);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACQA,IAAMA,YAAN,cAAwBC,MAAAA;EACtBC,YAAqBC,MAAcC,SAA2BC,SAAe;AAC3E,UAAMD,UAAU,GAAGD,SAASC,YAAYD,KAAKG,SAAQ,CAAE;gBADpCH;mBAAyCE;AAG5DE,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAMO,IAAMC,WAAN,cAAuBV,UAAAA;AAAW;AAMlC,IAAMW,cAAN,cAA0BX,UAAAA;AAAW;AAErC,IAAMY,iBAAN,cAA6BD,YAAAA;EAClCT,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,aAAaD,SAASC,OAAAA;EAC9B;AACF;AAEO,IAAMQ,qBAAN,cAAiCH,SAAAA;EACtCR,YAAYE,SAAiBC,SAAe;AAC1C,UAAM,kBAAkBD,SAASC,OAAAA;EACnC;AACF;AAEO,IAAMS,iCAAN,cAA6CJ,SAAAA;EAClDR,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,qCAAqCD,SAASC,OAAAA;EACtD;AACF;AAEO,IAAMU,sBAAN,cAAkCJ,YAAAA;EACvCT,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,mBAAmBD,SAASC,OAAAA;EACpC;AACF;",
|
|
6
|
+
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "CancelledError", "InvalidConfigError", "RemoteServiceConnectionTimeout", "DataCorruptionError"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":4823,"imports":[]},"packages/sdk/errors/src/index.ts":{"bytes":370,"imports":[{"path":"packages/sdk/errors/src/errors.ts","kind":"import-statement","original":"./errors"}]}},"outputs":{"packages/sdk/errors/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2567},"packages/sdk/errors/dist/lib/node/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/sdk/errors/src/index.ts","inputs":{"packages/sdk/errors/src/index.ts":{"bytesInOutput":365},"packages/sdk/errors/src/errors.ts":{"bytesInOutput":925}},"bytes":2413}}}
|
|
@@ -28,5 +28,8 @@ export declare class InvalidConfigError extends ApiError {
|
|
|
28
28
|
export declare class RemoteServiceConnectionTimeout extends ApiError {
|
|
29
29
|
constructor(message?: string, context?: any);
|
|
30
30
|
}
|
|
31
|
+
export declare class DataCorruptionError extends SystemError {
|
|
32
|
+
constructor(message?: string, context?: any);
|
|
33
|
+
}
|
|
31
34
|
export {};
|
|
32
35
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,cAAM,SAAU,SAAQ,KAAK;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAoB,QAAQ,CAAC,OAAO,CAAC;gBAAjD,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAW,OAAO,CAAC,KAAK;CAK5E;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,SAAS;CAAG;AAE1C;;;GAGG;AACH,qBAAa,WAAY,SAAQ,SAAS;CAAG;AAE7C,qBAAa,cAAe,SAAQ,WAAW;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG5C;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG3C;AAED,qBAAa,8BAA+B,SAAQ,QAAQ;gBAC9C,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG5C"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,cAAM,SAAU,SAAQ,KAAK;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAoB,QAAQ,CAAC,OAAO,CAAC;gBAAjD,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAW,OAAO,CAAC,KAAK;CAK5E;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,SAAS;CAAG;AAE1C;;;GAGG;AACH,qBAAa,WAAY,SAAQ,SAAS;CAAG;AAE7C,qBAAa,cAAe,SAAQ,WAAW;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG5C;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG3C;AAED,qBAAa,8BAA+B,SAAQ,QAAQ;gBAC9C,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG5C;AAED,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAG5C"}
|