effect-errors 1.0.6 → 1.0.8

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.
@@ -28,9 +28,14 @@ var prettyErrorMessage = function (u) {
28
28
  if (typeof u === 'string') {
29
29
  return "\uD83D\uDCA5 ".concat(u);
30
30
  }
31
+ // TaggedError with error ctor
31
32
  if (u instanceof Error && (0, Predicate_1.hasProperty)(u, 'error')) {
32
33
  return "\uD83D\uDCA5 ".concat(chalk_1.default.bgRed(" ".concat(u.name, " ")), " ").concat(chalk_1.default.bold.whiteBright("\u2022 ".concat(u.error)), "\r\n");
33
34
  }
35
+ // TaggedError with cause
36
+ if (u instanceof Error && (0, Predicate_1.hasProperty)(u, 'cause')) {
37
+ return "\uD83D\uDCA5 ".concat(chalk_1.default.bgRed(" ".concat(u.name, " ")), " ").concat(chalk_1.default.bold.whiteBright("\u2022 ".concat(u.cause)), "\r\n");
38
+ }
34
39
  if ((0, Predicate_1.hasProperty)(u, 'toString') &&
35
40
  (0, Function_1.isFunction)(u['toString']) &&
36
41
  u['toString'] !== Object.prototype.toString &&
package/package.json CHANGED
@@ -2,9 +2,9 @@
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.6",
5
+ "version": "1.0.8",
6
6
  "author": "jpb06 <jp.bois.06@outlook.fr>",
7
- "description": "Getting user stats from github",
7
+ "description": "A POC for errors reporting in Effect",
8
8
  "keywords": [],
9
9
  "license": "MIT",
10
10
  "engines": {
@@ -22,6 +22,7 @@
22
22
  "run-examples": "for i in ./src/examples/*.ts; do bun run $i; done"
23
23
  },
24
24
  "dependencies": {
25
+ "@effect/schema": "^0.63.2",
25
26
  "chalk": "^5.3.0",
26
27
  "dotenv-flow": "^4.1.0",
27
28
  "effect": "^2.4.1"