yerror 7.0.0 → 9.0.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # [9.0.0](https://github.com/nfroidure/yerror/compare/v8.0.0...v9.0.0) (2026-03-25)
2
+
3
+ # [8.0.0](https://github.com/nfroidure/yerror/compare/v7.0.0...v8.0.0) (2023-08-12)
4
+
5
+
6
+
1
7
  # [7.0.0](https://github.com/nfroidure/yerror/compare/v6.2.1...v7.0.0) (2023-08-11)
2
8
 
3
9
 
package/README.md CHANGED
@@ -8,7 +8,6 @@
8
8
  > It helps to know why you got an error.
9
9
 
10
10
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/yerror/blob/main/LICENSE)
11
- [![Coverage Status](https://coveralls.io/repos/github/git://github.com/nfroidure/yerror.git/badge.svg?branch=main)](https://coveralls.io/github/git://github.com/nfroidure/yerror.git?branch=main)
12
11
 
13
12
 
14
13
  [//]: # (::contents:start)
@@ -79,7 +78,7 @@ doSomethingAsync('nuts', 'code')
79
78
 
80
79
  <dl>
81
80
  <dt><a href="#YError">YError</a> ⇐ <code>Error</code></dt>
82
- <dd><p>A YError class able to contain some params and
81
+ <dd><p>A YError class able to contain some debugValues and
83
82
  print better stack traces</p>
84
83
  </dd>
85
84
  </dl>
@@ -88,7 +87,7 @@ doSomethingAsync('nuts', 'code')
88
87
 
89
88
  <dl>
90
89
  <dt><a href="#printStackTrace">printStackTrace(err)</a> ⇒ <code>string</code></dt>
91
- <dd><p>Allow to print a stack from anything (especially catched
90
+ <dd><p>Allow to print a stack from anything (especially caught
92
91
  errors that may or may not contain errors 🤷).</p>
93
92
  </dd>
94
93
  </dl>
@@ -96,22 +95,35 @@ doSomethingAsync('nuts', 'code')
96
95
  <a name="YError"></a>
97
96
 
98
97
  ## YError ⇐ <code>Error</code>
99
- A YError class able to contain some params and
98
+ A YError class able to contain some debugValues and
100
99
  print better stack traces
101
100
 
102
101
  **Kind**: global class
103
102
  **Extends**: <code>Error</code>
104
103
 
105
104
  * [YError](#YError) ⇐ <code>Error</code>
106
- * [.wrap(err, [errorCode], [...params])](#YError.wrap) ⇒ [<code>YError</code>](#YError)
107
- * [.cast(err, [errorCode], [...params])](#YError.cast) ⇒ [<code>YError</code>](#YError)
108
- * [.bump(err, [errorCode], [...params])](#YError.bump) ⇒ [<code>YError</code>](#YError)
105
+ * [new YError([errorCode], [debugValues])](#new_YError_new)
106
+ * [.wrap(err, [errorCode], [debugValues])](#YError.wrap) ⇒ [<code>YError</code>](#YError)
107
+ * [.cast(err, [errorCode], [debugValues])](#YError.cast) ⇒ [<code>YError</code>](#YError)
108
+ * [.bump(err, [errorCode], [debugValues])](#YError.bump) ⇒ [<code>YError</code>](#YError)
109
+
110
+ <a name="new_YError_new"></a>
111
+
112
+ ### new YError([errorCode], [debugValues])
113
+ Creates a new YError with an error code
114
+ and some debugValues as debug values.
115
+
116
+
117
+ | Param | Type | Default | Description |
118
+ | --- | --- | --- | --- |
119
+ | [errorCode] | <code>string</code> | <code>&quot;&#x27;E_UNEXPECTED&#x27;&quot;</code> | The error code corresponding to the actual error |
120
+ | [debugValues] | <code>any</code> | | Some additional debugging values |
109
121
 
110
122
  <a name="YError.wrap"></a>
111
123
 
112
- ### YError.wrap(err, [errorCode], [...params]) ⇒ [<code>YError</code>](#YError)
124
+ ### YError.wrap(err, [errorCode], [debugValues]) ⇒ [<code>YError</code>](#YError)
113
125
  Wraps any error and output a YError with an error
114
- code and some params as debug values.
126
+ code and some debugValues as debug values.
115
127
 
116
128
  **Kind**: static method of [<code>YError</code>](#YError)
117
129
  **Returns**: [<code>YError</code>](#YError) - The wrapped error
@@ -120,13 +132,13 @@ Wraps any error and output a YError with an error
120
132
  | --- | --- | --- | --- |
121
133
  | err | <code>Error</code> | | The error to wrap |
122
134
  | [errorCode] | <code>string</code> | <code>&quot;&#x27;E_UNEXPECTED&#x27;&quot;</code> | The error code corresponding to the actual error |
123
- | [...params] | <code>YErrorParams</code> | | Some additional debugging values |
135
+ | [debugValues] | <code>any</code> | | Some additional debugging values |
124
136
 
125
137
  <a name="YError.cast"></a>
126
138
 
127
- ### YError.cast(err, [errorCode], [...params]) ⇒ [<code>YError</code>](#YError)
139
+ ### YError.cast(err, [errorCode], [debugValues]) ⇒ [<code>YError</code>](#YError)
128
140
  Return a YError as is or wraps any other error and output
129
- a YError with a code and some params as debug values.
141
+ a YError with a code and some debugValues as debug values.
130
142
 
131
143
  **Kind**: static method of [<code>YError</code>](#YError)
132
144
  **Returns**: [<code>YError</code>](#YError) - The wrapped error
@@ -135,11 +147,11 @@ Return a YError as is or wraps any other error and output
135
147
  | --- | --- | --- | --- |
136
148
  | err | <code>Error</code> | | The error to cast |
137
149
  | [errorCode] | <code>string</code> | <code>&quot;&#x27;E_UNEXPECTED&#x27;&quot;</code> | The error code corresponding to the actual error |
138
- | [...params] | <code>YErrorParams</code> | | Some additional debugging values |
150
+ | [debugValues] | <code>any</code> | | Some additional debugging values |
139
151
 
140
152
  <a name="YError.bump"></a>
141
153
 
142
- ### YError.bump(err, [errorCode], [...params]) ⇒ [<code>YError</code>](#YError)
154
+ ### YError.bump(err, [errorCode], [debugValues]) ⇒ [<code>YError</code>](#YError)
143
155
  Same than `YError.wrap()` but preserves the code
144
156
  and the debug values of the error if it is
145
157
  already an instance of the YError constructor.
@@ -151,12 +163,12 @@ Same than `YError.wrap()` but preserves the code
151
163
  | --- | --- | --- | --- |
152
164
  | err | <code>Error</code> | | The error to bump |
153
165
  | [errorCode] | <code>string</code> | <code>&quot;&#x27;E_UNEXPECTED&#x27;&quot;</code> | The error code corresponding to the actual error |
154
- | [...params] | <code>YErrorParams</code> | | Some additional debugging values |
166
+ | [debugValues] | <code>any</code> | | Some additional debugging values |
155
167
 
156
168
  <a name="printStackTrace"></a>
157
169
 
158
170
  ## printStackTrace(err) ⇒ <code>string</code>
159
- Allow to print a stack from anything (especially catched
171
+ Allow to print a stack from anything (especially caught
160
172
  errors that may or may not contain errors 🤷).
161
173
 
162
174
  **Kind**: global function
package/dist/index.d.ts CHANGED
@@ -1,49 +1,48 @@
1
- type YErrorParams = any;
1
+ export type YErrorDebugValue = unknown;
2
2
  /**
3
- * A YError class able to contain some params and
3
+ * A YError class able to contain some debugValues and
4
4
  * print better stack traces
5
5
  * @extends Error
6
6
  */
7
- declare class YError extends Error {
7
+ declare class YError<T = YErrorDebugValue> extends Error {
8
8
  code: string;
9
- params: YErrorParams[];
9
+ debugValues: T[];
10
10
  wrappedErrors: (Error | YError)[];
11
11
  /**
12
12
  * Creates a new YError with an error code
13
- * and some params as debug values.
13
+ * and some debugValues as debug values.
14
14
  * @param {string} [errorCode = 'E_UNEXPECTED']
15
15
  * The error code corresponding to the actual error
16
- * @param {...YErrorParams} [params]
16
+ * @param {any} [debugValues]
17
17
  * Some additional debugging values
18
18
  */
19
- constructor(errorCode: string, ...params: YErrorParams[]);
20
- constructor(wrappedErrors?: Error[], errorCode?: string, ...params: YErrorParams[]);
19
+ constructor(errorCode?: string, debugValues?: T[], wrappedErrors?: (Error | YError)[]);
21
20
  /**
22
21
  * Wraps any error and output a YError with an error
23
- * code and some params as debug values.
22
+ * code and some debugValues as debug values.
24
23
  * @param {Error} err
25
24
  * The error to wrap
26
25
  * @param {string} [errorCode = 'E_UNEXPECTED']
27
26
  * The error code corresponding to the actual error
28
- * @param {...YErrorParams} [params]
27
+ * @param {any} [debugValues]
29
28
  * Some additional debugging values
30
29
  * @return {YError}
31
30
  * The wrapped error
32
31
  */
33
- static wrap<E extends Error | YError>(err: E, errorCode?: string, ...params: YErrorParams[]): YError;
32
+ static wrap<T = YErrorDebugValue>(err: Error | YError, errorCode?: string, debugValues?: T[]): YError;
34
33
  /**
35
34
  * Return a YError as is or wraps any other error and output
36
- * a YError with a code and some params as debug values.
35
+ * a YError with a code and some debugValues as debug values.
37
36
  * @param {Error} err
38
37
  * The error to cast
39
38
  * @param {string} [errorCode = 'E_UNEXPECTED']
40
39
  * The error code corresponding to the actual error
41
- * @param {...YErrorParams} [params]
40
+ * @param {any} [debugValues]
42
41
  * Some additional debugging values
43
42
  * @return {YError}
44
43
  * The wrapped error
45
44
  */
46
- static cast<E extends Error | YError>(err: E, errorCode?: string, ...params: YErrorParams[]): YError;
45
+ static cast<T = YErrorDebugValue>(err: Error | YError, errorCode?: string, debugValues?: T[]): YError;
47
46
  /**
48
47
  * Same than `YError.wrap()` but preserves the code
49
48
  * and the debug values of the error if it is
@@ -52,16 +51,16 @@ declare class YError extends Error {
52
51
  * The error to bump
53
52
  * @param {string} [errorCode = 'E_UNEXPECTED']
54
53
  * The error code corresponding to the actual error
55
- * @param {...YErrorParams} [params]
54
+ * @param {any} [debugValues]
56
55
  * Some additional debugging values
57
56
  * @return {YError}
58
57
  * The wrapped error
59
58
  */
60
- static bump<E extends Error | YError>(err: E, errorCode?: string, ...params: YErrorParams[]): YError;
59
+ static bump<T = YErrorDebugValue>(err: Error | YError, errorCode?: string, debugValues?: T[]): YError;
61
60
  toString(): string;
62
61
  }
63
62
  /**
64
- * Allow to print a stack from anything (especially catched
63
+ * Allow to print a stack from anything (especially caught
65
64
  * errors that may or may not contain errors 🤷).
66
65
  * @param {Error} err
67
66
  * The error to print
@@ -69,4 +68,6 @@ declare class YError extends Error {
69
68
  * The stack trace if any
70
69
  */
71
70
  export declare function printStackTrace(err: Error | YError): string;
71
+ export declare function looksLikeAYError(err: Error | YError): err is YError;
72
+ export declare function looksLikeAYErrorCode(str: string): boolean;
72
73
  export { YError };
package/dist/index.js CHANGED
@@ -1,25 +1,27 @@
1
- import os from 'os';
1
+ import { EOL } from 'node:os';
2
2
  /**
3
- * A YError class able to contain some params and
3
+ * A YError class able to contain some debugValues and
4
4
  * print better stack traces
5
5
  * @extends Error
6
6
  */
7
7
  class YError extends Error {
8
8
  code;
9
- params;
10
- wrappedErrors;
11
- constructor(wrappedErrors, errorCode, ...params) {
12
- // Detecting if wrappedErrors are passed
13
- if (!(wrappedErrors instanceof Array)) {
14
- params = ('undefined' === typeof errorCode ? [] : [errorCode]).concat(params);
15
- errorCode = wrappedErrors;
16
- wrappedErrors = [];
17
- }
9
+ debugValues = [];
10
+ wrappedErrors = [];
11
+ /**
12
+ * Creates a new YError with an error code
13
+ * and some debugValues as debug values.
14
+ * @param {string} [errorCode = 'E_UNEXPECTED']
15
+ * The error code corresponding to the actual error
16
+ * @param {any} [debugValues]
17
+ * Some additional debugging values
18
+ */
19
+ constructor(errorCode, debugValues = [], wrappedErrors = []) {
18
20
  // Call the parent constructor
19
21
  super(errorCode);
20
22
  // Filling error
21
23
  this.code = errorCode || 'E_UNEXPECTED';
22
- this.params = params;
24
+ this.debugValues = debugValues;
23
25
  this.wrappedErrors = wrappedErrors;
24
26
  this.name = this.toString();
25
27
  if (Error.captureStackTrace) {
@@ -28,18 +30,18 @@ class YError extends Error {
28
30
  }
29
31
  /**
30
32
  * Wraps any error and output a YError with an error
31
- * code and some params as debug values.
33
+ * code and some debugValues as debug values.
32
34
  * @param {Error} err
33
35
  * The error to wrap
34
36
  * @param {string} [errorCode = 'E_UNEXPECTED']
35
37
  * The error code corresponding to the actual error
36
- * @param {...YErrorParams} [params]
38
+ * @param {any} [debugValues]
37
39
  * Some additional debugging values
38
40
  * @return {YError}
39
41
  * The wrapped error
40
42
  */
41
- static wrap(err, errorCode, ...params) {
42
- const wrappedErrorIsACode = _looksLikeAYErrorCode(err.message);
43
+ static wrap(err, errorCode, debugValues = []) {
44
+ const wrappedErrorIsACode = looksLikeAYErrorCode(err.message);
43
45
  const wrappedErrors = ('wrappedErrors' in err ? err.wrappedErrors : []).concat(err);
44
46
  if (!errorCode) {
45
47
  if (wrappedErrorIsACode) {
@@ -49,28 +51,25 @@ class YError extends Error {
49
51
  errorCode = 'E_UNEXPECTED';
50
52
  }
51
53
  }
52
- if (err.message && !wrappedErrorIsACode) {
53
- params.push(err.message);
54
- }
55
- return new YError(wrappedErrors, errorCode, ...params);
54
+ return new YError(errorCode, debugValues, wrappedErrors);
56
55
  }
57
56
  /**
58
57
  * Return a YError as is or wraps any other error and output
59
- * a YError with a code and some params as debug values.
58
+ * a YError with a code and some debugValues as debug values.
60
59
  * @param {Error} err
61
60
  * The error to cast
62
61
  * @param {string} [errorCode = 'E_UNEXPECTED']
63
62
  * The error code corresponding to the actual error
64
- * @param {...YErrorParams} [params]
63
+ * @param {any} [debugValues]
65
64
  * Some additional debugging values
66
65
  * @return {YError}
67
66
  * The wrapped error
68
67
  */
69
- static cast(err, errorCode, ...params) {
70
- if (_looksLikeAYError(err)) {
68
+ static cast(err, errorCode, debugValues = []) {
69
+ if (looksLikeAYError(err)) {
71
70
  return err;
72
71
  }
73
- return YError.wrap(err, errorCode, ...params);
72
+ return YError.wrap(err, errorCode, debugValues);
74
73
  }
75
74
  /**
76
75
  * Same than `YError.wrap()` but preserves the code
@@ -80,32 +79,32 @@ class YError extends Error {
80
79
  * The error to bump
81
80
  * @param {string} [errorCode = 'E_UNEXPECTED']
82
81
  * The error code corresponding to the actual error
83
- * @param {...YErrorParams} [params]
82
+ * @param {any} [debugValues]
84
83
  * Some additional debugging values
85
84
  * @return {YError}
86
85
  * The wrapped error
87
86
  */
88
- static bump(err, errorCode, ...params) {
89
- if (_looksLikeAYError(err)) {
90
- return YError.wrap(err, err.code, ...err.params);
87
+ static bump(err, errorCode, debugValues = []) {
88
+ if (looksLikeAYError(err)) {
89
+ return YError.wrap(err, err.code, err.debugValues);
91
90
  }
92
- return YError.wrap(err, errorCode, ...params);
91
+ return YError.wrap(err, errorCode, debugValues);
93
92
  }
94
93
  toString() {
95
- return ((this.wrappedErrors.length
96
- ? // eslint-disable-next-line
97
- this.wrappedErrors[this.wrappedErrors.length - 1].stack + os.EOL
98
- : '') +
99
- this.constructor.name +
100
- ': ' +
101
- this.code +
102
- ' (' +
103
- this.params.join(', ') +
104
- ')');
94
+ let debugValuesAsString;
95
+ try {
96
+ debugValuesAsString = JSON.stringify(this.debugValues);
97
+ }
98
+ catch {
99
+ debugValuesAsString = '<circular>';
100
+ }
101
+ return `${this.wrappedErrors.length
102
+ ? this.wrappedErrors[this.wrappedErrors.length - 1].stack + EOL
103
+ : ''}${this.constructor.name}: ${this.code} (${debugValuesAsString})`;
105
104
  }
106
105
  }
107
106
  /**
108
- * Allow to print a stack from anything (especially catched
107
+ * Allow to print a stack from anything (especially caught
109
108
  * errors that may or may not contain errors 🤷).
110
109
  * @param {Error} err
111
110
  * The error to print
@@ -120,20 +119,20 @@ export function printStackTrace(err) {
120
119
  : typeof err}`;
121
120
  }
122
121
  // In order to keep compatibility through major versions
123
- // we have to make kind of an cross major version instanceof
124
- function _looksLikeAYError(err) {
122
+ // we have to make kind of a cross major version instanceof
123
+ export function looksLikeAYError(err) {
125
124
  return (!!(err instanceof YError) ||
126
125
  !!(err.constructor &&
127
126
  err.constructor.name &&
128
127
  err.constructor.name.endsWith('Error') &&
129
128
  'code' in err &&
130
129
  'string' === typeof err.code &&
131
- _looksLikeAYErrorCode(err.code) &&
132
- 'params' in err &&
133
- err.params &&
134
- err.params instanceof Array));
130
+ looksLikeAYErrorCode(err.code) &&
131
+ 'debugValues' in err &&
132
+ err.debugValues &&
133
+ err.debugValues instanceof Array));
135
134
  }
136
- function _looksLikeAYErrorCode(str) {
135
+ export function looksLikeAYErrorCode(str) {
137
136
  return /^([A-Z0-9_]+)$/.test(str);
138
137
  }
139
138
  export { YError };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAKpB;;;;GAIG;AACH,MAAM,MAAO,SAAQ,KAAK;IACxB,IAAI,CAAS;IACb,MAAM,CAAiB;IACvB,aAAa,CAAqB;IAelC,YAAY,aAAa,EAAE,SAAS,EAAE,GAAG,MAAM;QAC7C,wCAAwC;QACxC,IAAI,CAAC,CAAC,aAAa,YAAY,KAAK,CAAC,EAAE;YACrC,MAAM,GAAG,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