| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Definitely not for this PR, but for what it's worth, I'd be in favor getting rid of ERR_INVALID_CALLBACK entirely and using ERR_INVALID_ARG_TYPE instead. It is very difficult for me to imagine a situation where ERR_INVALID_CALLBACK is more useful to someone than ERR_INVALID_ARG_TYPE. On the other hand, it is easy for me to imagine a situation where someone has to check for both ERR_INVALID_ARG_TYPE and ERR_INVALID_CALLBACK but they don't know it and they're only checking for ERR_INVALID_ARG_TYPE. Node.js has too many error codes and they are often not specific in a way that is helpful to end users. ERR_INVALID_CALLBACK seems to be one of those cases.
Sorry, something went wrong.
Sorry, something went wrong.
Thanks for the reply, very valuable thought. node.js does have too many error codes, I was confused when I first opened the error.js file too. ERR_INVALID_CALLBACK and ERR_INVALID_ARG_TYPE are also duplicates, and I personally agree with using ERR_INVALID_ARG_TYPE for both. However, ERR_INVALID_CALLBACK being a widely used error code, replacing it with ERR_INVALID_ARG_TYPE may cause compatibility issues. Perhaps we can replace it with ERR_INVALID_ARG_TYPE in the next major release? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #36609 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #36609 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
| Back | FazBrowse Home | New Git URL |
Try replacing all duplicate checks with validateCallback, Due to the scope of the changes, it may be necessary to run a benchmark.
Checklist