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 <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 11ed1e6 commit 71a2fa2

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎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
()=>{newWorker('file:///file_url');},
34-
/Ifyouwanttopassafile:\/\/URL,youmustwrapitaround`newURL`/
34+
/Wrapfile:\/\/URLswith`newURL`/
3535
);
3636
assert.throws(
3737
()=>{newWorker('relative_no_dot');},
3838
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
39-
/^((?!Ifyouwanttopassafile:\/\/URL,youmustwrapitaround`newURL`).)*$/s
39+
/^((?!Wrapfile:\/\/URLswith`newURL`).)*$/s
4040
);
4141
}
4242

0 commit comments

Comments
 (0)