Skip to content

Commit ea4302b

Browse files
cjihrigtargos
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 4ec25b4 commit ea4302b

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
@@ -1415,8 +1415,7 @@ E('ERR_WORKER_PATH', (filename) =>
14151415
'The worker script or module filename must be an absolute path or a ' +
14161416
'relative path starting with \'./\' or \'../\'.' +
14171417
(filename.startsWith('file://') ?
1418-
' If you want to pass a file:// URL, you must wrap it around `new URL`.' :
1419-
''
1418+
' Wrap file:// URLs with `new URL`.' : ''
14201419
) +
14211420
` Received "${filename}"`,
14221421
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)