| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d9d6475 commit 2c439bb
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1228,7 +1228,9 @@ E('ERR_UNHANDLED_ERROR', | |||
| 1228 | 1228 | E('ERR_UNKNOWN_BUILTIN_MODULE', 'No such built-in module: %s', Error); | |
| 1229 | 1229 | E('ERR_UNKNOWN_CREDENTIAL', '%s identifier does not exist: %s', Error); | |
| 1230 | 1230 | E('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s', TypeError); | |
| 1231 | - E('ERR_UNKNOWN_FILE_EXTENSION', 'Unknown file extension: %s', TypeError); | ||
| 1231 | + E('ERR_UNKNOWN_FILE_EXTENSION', | ||
| 1232 | + 'Unknown file extension "%s" for %s imported from %s', | ||
| 1233 | + TypeError); | ||
| 1232 | 1234 | E('ERR_UNKNOWN_MODULE_FORMAT', 'Unknown module format: %s', RangeError); | |
| 1233 | 1235 | E('ERR_UNKNOWN_SIGNAL', 'Unknown signal: %s', TypeError); | |
| 1234 | 1236 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,10 @@ function resolve(specifier, parentURL) { | |||
| 116 | 116 | 'ExperimentalWarning'); | |
| 117 | 117 | format = legacyExtensionFormatMap[ext]; | |
| 118 | 118 | } else { | |
| 119 | - throw new ERR_UNKNOWN_FILE_EXTENSION(fileURLToPath(url)); | ||
| 119 | + throw new ERR_UNKNOWN_FILE_EXTENSION( | ||
| 120 | + ext, | ||
| 121 | + fileURLToPath(url), | ||
| 122 | + fileURLToPath(parentURL)); | ||
| 120 | 123 | } | |
| 121 | 124 | } | |
| 122 | 125 | return { url: `${url}`, format }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,8 +6,10 @@ const { spawnSync } = require('child_process'); | |||
| 6 | 6 | const fixture = fixtures.path('/es-modules/import-invalid-ext.mjs'); | |
| 7 | 7 | const child = spawnSync(process.execPath, [fixture]); | |
| 8 | 8 | const errMsg = 'TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension'; | |
| 9 | + const importMsg = `imported from ${fixture}`; | ||
| 9 | 10 | ||
| 10 | 11 | assert.strictEqual(child.status, 1); | |
| 11 | 12 | assert.strictEqual(child.signal, null); | |
| 12 | 13 | assert.strictEqual(child.stdout.toString().trim(), ''); | |
| 13 | 14 | assert(child.stderr.toString().includes(errMsg)); | |
| 15 | + assert(child.stderr.toString().includes(importMsg)); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments