Skip to content

Commit 81364a7

Browse files
Trotttargos
authored andcommitted
doc: clarify ERR_AMBIGUOUS_ARGUMENT
PR-URL: #22542 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent aa22dc8 commit 81364a7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/api/errors.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,12 @@ found [here][online].
581581
<a id="ERR_AMBIGUOUS_ARGUMENT"></a>
582582
### ERR_AMBIGUOUS_ARGUMENT
583583

584-
This is triggered by the `assert` module in case e.g.,
585-
`assert.throws(fn, message)` is used in a way that the message is the thrown
586-
error message. This is ambiguous because the message is not verifying the error
587-
message and will only be thrown in case no error is thrown.
584+
A function argument is being used in a way that suggests that the function
585+
signature may be misunderstood. This is thrown by the `assert` module when the
586+
`message` parameter in `assert.throws(block, message)` matches the error message
587+
thrown by `block` because that usage suggests that the user believes `message`
588+
is the expected message rather than the message the `AssertionError` will
589+
display if `block` does not throw.
588590

589591
<a id="ERR_ARG_NOT_ITERABLE"></a>
590592
### ERR_ARG_NOT_ITERABLE

0 commit comments

Comments
 (0)