GeezerVison is showing github.com — doc: clarify ERR_AMBIGUOUS_ARGUMENT · nodejs/node@81364a7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/errors.md +6-4Lines changed: 6 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -581,10 +581,12 @@ found [here][online]. |
581 | 581 | <a id="ERR_AMBIGUOUS_ARGUMENT"></a> |
582 | 582 | ### ERR_AMBIGUOUS_ARGUMENT |
583 | 583 |
|
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. |
588 | 590 |
|
589 | 591 | <a id="ERR_ARG_NOT_ITERABLE"></a> |
590 | 592 | ### ERR_ARG_NOT_ITERABLE |
|