@sprucelabs/error 7.0.33 → 7.1.1

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,6 +6,11 @@ class AbstractSpruceError extends Error {
6
6
  const { code } = options;
7
7
  super(code);
8
8
  this.options = options;
9
+ const env = typeof process !== 'undefined' && process.env ? process.env : {};
10
+ const key = `FRIENDLY_ERROR_MESSAGE_${code}`;
11
+ this.options.friendlyMessage = env[key]
12
+ ? env[key]
13
+ : this.options.friendlyMessage;
9
14
  if (options.originalError) {
10
15
  if (options.originalError instanceof Error) {
11
16
  this.originalError = options.originalError;
@@ -4,6 +4,11 @@ export default class AbstractSpruceError extends Error {
4
4
  const { code } = options;
5
5
  super(code);
6
6
  this.options = options;
7
+ const env = typeof process !== 'undefined' && process.env ? process.env : {};
8
+ const key = `FRIENDLY_ERROR_MESSAGE_${code}`;
9
+ this.options.friendlyMessage = env[key]
10
+ ? env[key]
11
+ : this.options.friendlyMessage;
7
12
  if (options.originalError) {
8
13
  if (options.originalError instanceof Error) {
9
14
  this.originalError = options.originalError;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "7.0.33",
6
+ "version": "7.1.1",
7
7
  "skill": {
8
8
  "namespace": "spruce-error",
9
9
  "upgradeIgnoreList": [
@@ -62,7 +62,7 @@
62
62
  "watch.tsc": "tsc -w"
63
63
  },
64
64
  "devDependencies": {
65
- "@sprucelabs/esm-postbuild": "^7.0.22",
65
+ "@sprucelabs/esm-postbuild": "^7.0.23",
66
66
  "@sprucelabs/semantic-release": "^5.0.2",
67
67
  "@sprucelabs/test": "^10.0.14",
68
68
  "chokidar-cli": "^3.0.0",