Skip to content

Commit 71a2fa2

Browse files
cjihrigMylesBorins
authored andcommitted
errors: drop pronouns from ERR_WORKER_PATH message
This commit drops pronouns from the ERR_WORKER_PATH message, and also shortens the text a bit. PR-URL: #32285 Refs: #31664 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 11ed1e6 commit 71a2fa2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/internal/errors.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,8 +1422,7 @@ E('ERR_WORKER_PATH', (filename) =>
14221422
'The worker script or module filename must be an absolute path or a ' +
14231423
'relative path starting with \'./\' or \'../\'.' +
14241424
(filename.startsWith('file://') ?
1425-
' If you want to pass a file:// URL, you must wrap it around `new URL`.' :
1426-
''
1425+
' Wrap file:// URLs with `new URL`.' : ''
14271426
) +
14281427
` Received "${filename}"`,
14291428
TypeError);

test/parallel/test-worker-unsupported-path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ const { Worker } = require('worker_threads');
3131
{
3232
assert.throws(
3333
() => { new Worker('file:///file_url'); },
34-
/If you want to pass a file:\/\/ URL, you must wrap it around `new URL`/
34+
/Wrap file:\/\/ URLs with `new URL`/
3535
);
3636
assert.throws(
3737
() => { new Worker('relative_no_dot'); },
3838
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
39-
/^((?!If you want to pass a file:\/\/ URL, you must wrap it around `new URL`).)*$/s
39+
/^((?!Wrap file:\/\/ URLs with `new URL`).)*$/s
4040
);
4141
}
4242

0 commit comments

Comments
 (0)