@dxos/errors 0.1.17 → 0.1.19
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/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @dxos/errors
|
|
2
|
+
|
|
3
|
+
Error definitions and utilities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i @dxos/errors
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## DXOS Resources
|
|
12
|
+
|
|
13
|
+
- [Website](https://dxos.org)
|
|
14
|
+
- [Developer Documentation](https://docs.dxos.org)
|
|
15
|
+
- Tag [questions on Stack Overflow](https://stackoverflow.com/questions/tagged/dxos) with `#dxos`
|
|
16
|
+
- Tag us on twitter [`@dxos_org`](https://twitter.com/dxos_org)
|
|
17
|
+
|
|
18
|
+
## Contributions
|
|
19
|
+
|
|
20
|
+
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs). If you would like to contribute to the design and implementation of DXOS, please [start with the contributor's guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md).
|
|
21
|
+
|
|
22
|
+
License: [MIT](./LICENSE) Copyright 2022 © DXOS
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
3
|
+
"sources": ["../../../src/errors.ts"],
|
|
4
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 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
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,qBAAN,cAAiCF,SAAAA;EACtCR,YAAYE,SAAiBC,SAAe;AAC1C,UAAM,kBAAkBD,SAASC,OAAAA;EACnC;AACF;AAEO,IAAMQ,iCAAN,cAA6CH,SAAAA;EAClDR,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,qCAAqCD,SAASC,OAAAA;EACtD;AACF;",
|
|
6
6
|
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "InvalidConfigError", "RemoteServiceConnectionTimeout"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/sdk/errors/src/errors.ts":{"bytes":3778,"imports":[]},"packages/sdk/errors/src/index.ts":{"bytes":370,"imports":[{"path":"packages/sdk/errors/src/errors.ts","kind":"import-statement"}]}},"outputs":{"packages/sdk/errors/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1886},"packages/sdk/errors/dist/lib/browser/index.mjs":{"imports":[],"exports":["ApiError","InvalidConfigError","RemoteServiceConnectionTimeout","SystemError"],"entryPoint":"packages/sdk/errors/src/index.ts","inputs":{"packages/sdk/errors/src/errors.ts":{"bytesInOutput":650},"packages/sdk/errors/src/index.ts":{"bytesInOutput":0}},"bytes":816}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/errors.ts"],
|
|
4
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 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
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,qBAAN,cAAiCF,SAAAA;EACtCR,YAAYE,SAAiBC,SAAe;AAC1C,UAAM,kBAAkBD,SAASC,OAAAA;EACnC;AACF;AAEO,IAAMQ,iCAAN,cAA6CH,SAAAA;EAClDR,YAAYE,SAAkBC,SAAe;AAC3C,UAAM,qCAAqCD,SAASC,OAAAA;EACtD;AACF;",
|
|
6
6
|
"names": ["BaseError", "Error", "constructor", "code", "message", "context", "toString", "Object", "setPrototypeOf", "prototype", "ApiError", "SystemError", "InvalidConfigError", "RemoteServiceConnectionTimeout"]
|
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":3778,"imports":[]},"packages/sdk/errors/src/index.ts":{"bytes":370,"imports":[{"path":"packages/sdk/errors/src/errors.ts","kind":"import-statement"}]}},"outputs":{"packages/sdk/errors/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2013},"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":275},"packages/sdk/errors/src/errors.ts":{"bytesInOutput":650}},"bytes":2007}}}
|