| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3a5856c commit 347b9f2
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1265,7 +1265,9 @@ E('ERR_INVALID_TUPLE', '%s must be an iterable %s tuple', TypeError); | |||
| 1265 | 1265 | E('ERR_INVALID_URI', 'URI malformed', URIError); | |
| 1266 | 1266 | E('ERR_INVALID_URL', function(input) { | |
| 1267 | 1267 | this.input = input; | |
| 1268 | - return `Invalid URL: ${input}`; | ||
| 1268 | + // Don't include URL in message. | ||
| 1269 | + // (See https://github.com/nodejs/node/pull/38614) | ||
| 1270 | + return 'Invalid URL'; | ||
| 1269 | 1271 | }, TypeError); | |
| 1270 | 1272 | E('ERR_INVALID_URL_SCHEME', | |
| 1271 | 1273 | (expected) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,8 +3,12 @@ import { expectsError, mustCall } from '../common/index.mjs'; | |||
| 3 | 3 | import assert from 'assert'; | |
| 4 | 4 | ||
| 5 | 5 | import('../fixtures/es-modules/test-esm-ok.mjs') | |
| 6 | - .then(assert.fail, expectsError({ | ||
| 7 | - code: 'ERR_INVALID_URL', | ||
| 8 | - message: 'Invalid URL: ../fixtures/es-modules/test-esm-ok.mjs' | ||
| 9 | - })) | ||
| 6 | + .then(assert.fail, (error) => { | ||
| 7 | + expectsError({ | ||
| 8 | + code: 'ERR_INVALID_URL', | ||
| 9 | + message: 'Invalid URL' | ||
| 10 | + })(error); | ||
| 11 | + | ||
| 12 | + assert.strictEqual(error.input, '../fixtures/es-modules/test-esm-ok.mjs'); | ||
| 13 | + }) | ||
| 10 | 14 | .then(mustCall()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,11 +55,8 @@ for (const test of failureTests) { | |||
| 55 | 55 | () => new URL(test.input, test.base), | |
| 56 | 56 | (error) => { | |
| 57 | 57 | assert.throws(() => { throw error; }, expectedError); | |
| 58 | - | ||
| 59 | - // The input could be processed, so we don't do strict matching here | ||
| 60 | - let match; | ||
| 61 | - assert(match = (`${error}`).match(/Invalid URL: (.*)$/)); | ||
| 62 | - assert.strictEqual(error.input, match[1]); | ||
| 58 | + assert.strictEqual(`${error}`, 'TypeError [ERR_INVALID_URL]: Invalid URL'); | ||
| 59 | + assert.strictEqual(error.message, 'Invalid URL'); | ||
| 63 | 60 | return true; | |
| 64 | 61 | }); | |
| 65 | 62 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments