From 5c6b2a472d1c6b887f40aa1895f4752f88d7952a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 26 Aug 2018 18:20:05 -0700 Subject: [PATCH 1/2] doc: clarify ERR_AMBIGUOUS_ARGUMENT --- doc/api/errors.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index f34b53e0110598..877270749571d1 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -581,10 +581,12 @@ found [here][online]. ### ERR_AMBIGUOUS_ARGUMENT -This is triggered by the `assert` module in case e.g., -`assert.throws(fn, message)` is used in a way that the message is the thrown -error message. This is ambiguous because the message is not verifying the error -message and will only be thrown in case no error is thrown. +An function argument is being used in a way that suggests that the function +signature may be misunderstood. This is thrown by the `assert` module when the +`message` parameter in `assert.throws(block, message)` matches the error message +thrown by `block` because that usage suggests that the user believes `message` +is the expected message rather than the message the `AssertionError` will +display if `block` does not throw. ### ERR_ARG_NOT_ITERABLE From 7e4c22a4ed42e02105f009250b06ff17be5684ca Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 26 Aug 2018 18:46:29 -0700 Subject: [PATCH 2/2] Update errors.md --- doc/api/errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 877270749571d1..4757496fa6ac93 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -581,7 +581,7 @@ found [here][online]. ### ERR_AMBIGUOUS_ARGUMENT -An function argument is being used in a way that suggests that the function +A function argument is being used in a way that suggests that the function signature may be misunderstood. This is thrown by the `assert` module when the `message` parameter in `assert.throws(block, message)` matches the error message thrown by `block` because that usage suggests that the user believes `message`