effect-errors 1.0.4 → 1.0.5
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.
|
@@ -6,10 +6,9 @@ var pretty_error_type_1 = require("../types/pretty-error.type");
|
|
|
6
6
|
var pretty_error_message_1 = require("./pretty-error-message");
|
|
7
7
|
var spanSymbol = Symbol.for('effect/SpanAnnotation');
|
|
8
8
|
var defaultRenderError = function (error) {
|
|
9
|
-
var _a;
|
|
10
9
|
var span = ((0, Predicate_1.hasProperty)(error, spanSymbol) && error[spanSymbol]);
|
|
11
10
|
if (error instanceof Error) {
|
|
12
|
-
return new pretty_error_type_1.PrettyError((0, pretty_error_message_1.prettyErrorMessage)(error),
|
|
11
|
+
return new pretty_error_type_1.PrettyError((0, pretty_error_message_1.prettyErrorMessage)(error), void 0, span);
|
|
13
12
|
}
|
|
14
13
|
return new pretty_error_type_1.PrettyError((0, pretty_error_message_1.prettyErrorMessage)(error), void 0, span);
|
|
15
14
|
};
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
2
18
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
19
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
20
|
};
|
|
@@ -10,13 +26,19 @@ var Predicate_1 = require("effect/Predicate");
|
|
|
10
26
|
var cwdRegex = new RegExp("".concat(process.cwd()), 'g');
|
|
11
27
|
var prettyErrorMessage = function (u) {
|
|
12
28
|
if (typeof u === 'string') {
|
|
13
|
-
return "
|
|
29
|
+
return "\uD83D\uDCA5 ".concat(u);
|
|
14
30
|
}
|
|
15
31
|
if ((0, Predicate_1.hasProperty)(u, 'toString') &&
|
|
16
32
|
(0, Function_1.isFunction)(u['toString']) &&
|
|
17
33
|
u['toString'] !== Object.prototype.toString &&
|
|
18
34
|
u['toString'] !== Array.prototype.toString) {
|
|
19
|
-
|
|
35
|
+
var message = u['toString']();
|
|
36
|
+
var maybeWithUnderlyingType = message.split(': ');
|
|
37
|
+
if (maybeWithUnderlyingType.length > 1) {
|
|
38
|
+
var _a = __read(maybeWithUnderlyingType), type = _a[0], message_1 = _a.slice(1);
|
|
39
|
+
return "\uD83D\uDCA5 ".concat(chalk_1.default.bgRed(" ".concat(type, " ")), " \u2022 ").concat(message_1);
|
|
40
|
+
}
|
|
41
|
+
return "\uD83D\uDCA5 ".concat(message);
|
|
20
42
|
}
|
|
21
43
|
if ((0, Predicate_1.hasProperty)(u, '_tag') && (0, Predicate_1.hasProperty)(u, 'message')) {
|
|
22
44
|
var message = u.message
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"repository": "https://github.com/jpb06/effect-errors.git",
|
|
3
3
|
"main": "dist/index.js",
|
|
4
4
|
"name": "effect-errors",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.5",
|
|
6
6
|
"author": "jpb06 <jp.bois.06@outlook.fr>",
|
|
7
7
|
"description": "Getting user stats from github",
|
|
8
8
|
"keywords": [],
|