From ecf4d39e0ef1253c07ae7a1962cad1336822a2f3 Mon Sep 17 00:00:00 2001 From: Utkarsh54pathak <142923072+Utkarsh54pathak@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:27:02 +0530 Subject: [PATCH 1/2] doc: improve ERR_AMBIGUOUS_ARGUMENT error message clarity Improves clarity of ERR_AMBIGUOUS_ARGUMENT by making the message more actionable and guiding users to provide explicit values or options objects. No behavior change. --- lib/internal/errors.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 206e2a24716022..7083be6433d365 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1133,7 +1133,11 @@ E('ERR_ACCESS_DENIED', return msg; }, Error); -E('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError); +E( + 'ERR_AMBIGUOUS_ARGUMENT', + 'The "%s" argument is ambiguous. %s Please check the function signature and provide a more explicit value or options object.', + TypeError +); E('ERR_ARG_NOT_ITERABLE', '%s must be iterable', TypeError); E('ERR_ASSERTION', '%s', Error); E('ERR_ASYNC_CALLBACK', '%s must be a function', TypeError); From 150a622c3524a42adabb1f87139a0ce9483b5c38 Mon Sep 17 00:00:00 2001 From: Utkarsh54pathak <142923072+Utkarsh54pathak@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:59:35 +0530 Subject: [PATCH 2/2] revert: remove non-actionable wording from ERR_AMBIGUOUS_ARGUMENT I've reverted the additional wording since it wasn't making the message more actionable. I understand that improving this likely requires adding more specific context at the call sites rather than changing the base error message. Happy to explore that in a follow-up if needed. --- lib/internal/errors.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 7083be6433d365..4e016183e6d4b8 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1133,11 +1133,7 @@ E('ERR_ACCESS_DENIED', return msg; }, Error); -E( - 'ERR_AMBIGUOUS_ARGUMENT', - 'The "%s" argument is ambiguous. %s Please check the function signature and provide a more explicit value or options object.', - TypeError -); +E('ERR_AMBIGUOUS_ARGUMENT','The "%s" argument is ambiguous. %s',TypeError); E('ERR_ARG_NOT_ITERABLE', '%s must be iterable', TypeError); E('ERR_ASSERTION', '%s', Error); E('ERR_ASYNC_CALLBACK', '%s must be a function', TypeError);