@webiny/error 5.39.0-beta.0 → 5.39.0-beta.2
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/Error.js +2 -4
- package/Error.js.map +1 -1
- package/package.json +4 -4
package/Error.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
class WError extends Error {
|
|
8
|
+
code = null;
|
|
9
|
+
data = null;
|
|
10
10
|
constructor(messageOrOptions, code, data) {
|
|
11
11
|
// TODO in TS 4.6 we can move that into if statements
|
|
12
12
|
super(typeof messageOrOptions === "string" ? messageOrOptions : messageOrOptions.message);
|
|
13
|
-
(0, _defineProperty2.default)(this, "code", null);
|
|
14
|
-
(0, _defineProperty2.default)(this, "data", null);
|
|
15
13
|
if (typeof messageOrOptions === "string") {
|
|
16
14
|
// super(messageOrOptions); - use after TS 4.6
|
|
17
15
|
this.code = code || null;
|
package/Error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WError","Error","
|
|
1
|
+
{"version":3,"names":["WError","Error","code","data","constructor","messageOrOptions","message","from","err","options","Object","assign","exports","default"],"sources":["Error.ts"],"sourcesContent":["export interface ErrorOptions<TData = any> {\n message?: string;\n code?: string;\n data?: TData;\n}\n\nexport default class WError<TData = any> extends Error {\n public readonly code: string | null = null;\n public readonly data: TData | null = null;\n\n constructor(message: string, code?: string, data?: TData);\n constructor(options: ErrorOptions<TData>);\n constructor(messageOrOptions: string | ErrorOptions<TData>, code?: string, data?: TData) {\n // TODO in TS 4.6 we can move that into if statements\n super(typeof messageOrOptions === \"string\" ? messageOrOptions : messageOrOptions.message);\n\n if (typeof messageOrOptions === \"string\") {\n // super(messageOrOptions); - use after TS 4.6\n this.code = code || null;\n this.data = data || null;\n } else {\n // super(messageOrOptions.message); - use after TS 4.6\n this.code = messageOrOptions.code || null;\n this.data = messageOrOptions.data || null;\n }\n }\n\n public static from<TData = any>(err: Partial<WError>, options: ErrorOptions<TData> = {}) {\n return new WError({\n message: err.message || options.message,\n code: err.code || options.code,\n data: Object.assign({}, err.data, options.data)\n });\n }\n}\n"],"mappings":";;;;;;AAMe,MAAMA,MAAM,SAAsBC,KAAK,CAAC;EACnCC,IAAI,GAAkB,IAAI;EAC1BC,IAAI,GAAiB,IAAI;EAIzCC,WAAWA,CAACC,gBAA8C,EAAEH,IAAa,EAAEC,IAAY,EAAE;IACrF;IACA,KAAK,CAAC,OAAOE,gBAAgB,KAAK,QAAQ,GAAGA,gBAAgB,GAAGA,gBAAgB,CAACC,OAAO,CAAC;IAEzF,IAAI,OAAOD,gBAAgB,KAAK,QAAQ,EAAE;MACtC;MACA,IAAI,CAACH,IAAI,GAAGA,IAAI,IAAI,IAAI;MACxB,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,IAAI;IAC5B,CAAC,MAAM;MACH;MACA,IAAI,CAACD,IAAI,GAAGG,gBAAgB,CAACH,IAAI,IAAI,IAAI;MACzC,IAAI,CAACC,IAAI,GAAGE,gBAAgB,CAACF,IAAI,IAAI,IAAI;IAC7C;EACJ;EAEA,OAAcI,IAAIA,CAAcC,GAAoB,EAAEC,OAA4B,GAAG,CAAC,CAAC,EAAE;IACrF,OAAO,IAAIT,MAAM,CAAC;MACdM,OAAO,EAAEE,GAAG,CAACF,OAAO,IAAIG,OAAO,CAACH,OAAO;MACvCJ,IAAI,EAAEM,GAAG,CAACN,IAAI,IAAIO,OAAO,CAACP,IAAI;MAC9BC,IAAI,EAAEO,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEH,GAAG,CAACL,IAAI,EAAEM,OAAO,CAACN,IAAI;IAClD,CAAC,CAAC;EACN;AACJ;AAACS,OAAA,CAAAC,OAAA,GAAAb,MAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/error",
|
|
3
|
-
"version": "5.39.0-beta.
|
|
3
|
+
"version": "5.39.0-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/cli": "7.22.6",
|
|
18
18
|
"@babel/core": "7.22.8",
|
|
19
|
-
"@webiny/cli": "5.39.0-beta.
|
|
20
|
-
"@webiny/project-utils": "5.39.0-beta.
|
|
19
|
+
"@webiny/cli": "5.39.0-beta.2",
|
|
20
|
+
"@webiny/project-utils": "5.39.0-beta.2",
|
|
21
21
|
"rimraf": "3.0.2",
|
|
22
22
|
"ttypescript": "1.5.15",
|
|
23
23
|
"typescript": "4.7.4"
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"build": "yarn webiny run build",
|
|
27
27
|
"watch": "yarn webiny run watch"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "193039382160557448f23f43685f29136f58f87a"
|
|
30
30
|
}
|