Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: drop pronouns from ERR_WORKER_PATH message #32285

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,7 @@ E('ERR_WORKER_PATH', (filename) =>
'The worker script or module filename must be an absolute path or a ' +
'relative path starting with \'./\' or \'../\'.' +
(filename.startsWith('file://') ?
' If you want to pass a file:// URL, you must wrap it around `new URL`.' :
''
' Wrap file:// URLs with `new URL`.' : ''
) +
` Received "${filename}"`,
TypeError);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-worker-unsupported-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const { Worker } = require('worker_threads');
{
assert.throws(
() => { new Worker('file:///file_url'); },
/If you want to pass a file:\/\/ URL, you must wrap it around `new URL`/
/Wrap file:\/\/ URLs with `new URL`/
);
assert.throws(
() => { new Worker('relative_no_dot'); },
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
/^((?!If you want to pass a file:\/\/ URL, you must wrap it around `new URL`).)*$/s
/^((?!Wrap file:\/\/ URLs with `new URL`).)*$/s
);
}

Expand Down