| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f308b4d commit 873e2f2
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -576,6 +576,12 @@ The `ERR_CONSOLE_WRITABLE_STREAM` error code is thrown when `Console` is | |||
| 576 | 576 | instantiated without `stdout` stream or when `stdout` or `stderr` streams | |
| 577 | 577 | are not writable. | |
| 578 | 578 | ||
| 579 | + <a id="ERR_FALSY_VALUE_REJECTION"></a> | ||
| 580 | + ### ERR_FALSY_VALUE_REJECTION | ||
| 581 | + | ||
| 582 | + The `ERR_FALSY_VALUE_REJECTION` error code is used by the `util.callbackify()` | ||
| 583 | + API when a callbackified `Promise` is rejected with a falsy value (e.g. `null`). | ||
| 584 | + | ||
| 579 | 585 | <a id="ERR_INDEX_OUT_OF_RANGE"></a> | |
| 580 | 586 | ### ERR_INDEX_OUT_OF_RANGE | |
| 581 | 587 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,6 +115,7 @@ E('ERR_ASSERTION', (msg) => msg); | |||
| 115 | 115 | E('ERR_CONSOLE_WRITABLE_STREAM', | |
| 116 | 116 | (name) => `Console expects a writable stream instance for ${name}`); | |
| 117 | 117 | E('ERR_CPU_USAGE', (errMsg) => `Unable to obtain cpu usage ${errMsg}`); | |
| 118 | + E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value'); | ||
| 118 | 119 | E('ERR_HTTP_HEADERS_SENT', | |
| 119 | 120 | 'Cannot render headers after they are sent to the client'); | |
| 120 | 121 | E('ERR_HTTP_INVALID_CHAR', 'Invalid character in statusMessage.'); | |
@@ -166,7 +167,6 @@ E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536'); | |||
| 166 | 167 | E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running'); | |
| 167 | 168 | E('ERR_V8BREAKITERATOR', 'full ICU data not installed. ' + | |
| 168 | 169 | 'See https://github.com/nodejs/node/wiki/Intl'); | |
| 169 | - E('FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value'); | ||
| 170 | 170 | // Add new errors from here... | |
| 171 | 171 | ||
| 172 | 172 | function invalidArgType(name, expected, actual) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1054,7 +1054,7 @@ function callbackifyOnRejected(reason, cb) { | |||
| 1054 | 1054 | // occurred", we error-wrap so the callback consumer can distinguish between | |
| 1055 | 1055 | // "the promise rejected with null" or "the promise fulfilled with undefined". | |
| 1056 | 1056 | if (!reason) { | |
| 1057 | - const newReason = new errors.Error('FALSY_VALUE_REJECTION'); | ||
| 1057 | + const newReason = new errors.Error('ERR_FALSY_VALUE_REJECTION'); | ||
| 1058 | 1058 | newReason.reason = reason; | |
| 1059 | 1059 | reason = newReason; | |
| 1060 | 1060 | Error.captureStackTrace(reason, callbackifyOnRejected); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ const values = [ | |||
| 79 | 79 | if (err instanceof Error) { | |
| 80 | 80 | if ('reason' in err) { | |
| 81 | 81 | assert(!value); | |
| 82 | - assert.strictEqual(err.code, 'FALSY_VALUE_REJECTION'); | ||
| 82 | + assert.strictEqual(err.code, 'ERR_FALSY_VALUE_REJECTION'); | ||
| 83 | 83 | assert.strictEqual(err.reason, value); | |
| 84 | 84 | } else { | |
| 85 | 85 | assert.strictEqual(String(value).endsWith(err.message), true); | |
@@ -100,7 +100,7 @@ const values = [ | |||
| 100 | 100 | if (err instanceof Error) { | |
| 101 | 101 | if ('reason' in err) { | |
| 102 | 102 | assert(!value); | |
| 103 | - assert.strictEqual(err.code, 'FALSY_VALUE_REJECTION'); | ||
| 103 | + assert.strictEqual(err.code, 'ERR_FALSY_VALUE_REJECTION'); | ||
| 104 | 104 | assert.strictEqual(err.reason, value); | |
| 105 | 105 | } else { | |
| 106 | 106 | assert.strictEqual(String(value).endsWith(err.message), true); | |
@@ -125,7 +125,7 @@ const values = [ | |||
| 125 | 125 | if (err instanceof Error) { | |
| 126 | 126 | if ('reason' in err) { | |
| 127 | 127 | assert(!value); | |
| 128 | - assert.strictEqual(err.code, 'FALSY_VALUE_REJECTION'); | ||
| 128 | + assert.strictEqual(err.code, 'ERR_FALSY_VALUE_REJECTION'); | ||
| 129 | 129 | assert.strictEqual(err.reason, value); | |
| 130 | 130 | } else { | |
| 131 | 131 | assert.strictEqual(String(value).endsWith(err.message), true); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments