Skip to content

Commit e60efa7

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 <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7c8ebd0 commit e60efa7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/internal/errors.js

+1-2
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

+2-2
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)