-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib: alter wrong argument number error message #22130
Conversation
The ZCtx::Init function presents a standard CHECK to handle the argument number. The correct number of arguments as of now is 7. The CHECK usage follows the standard usage in the node C++ code, yet this is the only instance where the error message is long enough so as to be split in two lines. The macro CHECK displays this error message incorrectly. The fix revolves around a copy of the macro, injected in the point of code where the previous CHECK was residing; it formats the message in the same way the macro would have and cleanly exits the execution. Fixes: nodejs#16987
Thank you for your contribution, @amarchino! 😃 I won't stand in the way, but to be honest, I am not sure whether the relatively small improvement in readability of a debugging message that should barely ever be visible to users justifies the added complexity. Plus, there are many other places in core which use the same or similar ways to include custom messages in assertions. |
I am, for the most part, in agreement with Your point, @tniessen. Thanks! |
I don’t think I have anything to add to @tniessen’s reply here. :) |
Thanks Anna. I am closing this based on the previous discussion. Thank you for your contribution, @amarchino, we are looking forward to more! |
Thanks to all af You for the attention and time You spent! |
The ZCtx::Init function presents a standard CHECK to handle the
argument number. The correct number of arguments as of now is 7.
The CHECK usage follows the standard usage in the node C++ code, yet
this is the only instance where the error message is long enough so as
to be split in two lines. The macro CHECK displays this error message
incorrectly.
The fix revolves around a copy of the macro, injected in the point of
code where the previous CHECK was residing; it formats the message in
the same way the macro would have and cleanly exits the execution.
Fixes: #16987
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesNotes:
core-validate-commit
fails due to absence of PR-URL and reviewer (might it be acceptable in opening the pull request?)I remain at disposal for every problem that maight arise.
Thanks!