http2: replace unreachable error with assertion#24407
http2: replace unreachable error with assertion#24407Trott wants to merge 1 commit intonodejs:masterfrom
Conversation
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: nodejs#20673
|
@nodejs/http2 |
|
How do we decide between using |
Is there a |
|
Yes. CHECK macros were added in #18852 |
Hmmm....in general, I prefer But I guess the real things to consider are:
In this case, I think |
|
I do not understand your reasoning. |
I guess I do not understand how |
My understanding is that the |
Ok so it's more subtle. Lines 1 to 7 in 5dc47a4 DCHECK*s are turned into an almost no-op.Lines 1 to 7 in 5dc47a4 BTW: I think we should turn |
i.e. |
|
So, in this case, it seems |
|
(What's the purpose of wrapping the code in |
It's an old C P.S. I think there are places where this is the definition of cruft. |
That's right, I should have said it has a small runtime cost compared to loading the assert module and calling it. I obviously don't understand the purpose of CHECKs so please don't block this PR any longer because of me 😅. I thought that the macros were added with the goal to replace internal uses of |
I've had it on my mental to-do list to make a tiny I won't be mad if someone else does that before I ever get to it. :-D |
|
Landed in 566a694 |
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: nodejs#20673
PR-URL: nodejs#24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
I have a long lasting dream of getting |
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: #20673
PR-URL: #24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: #20673
PR-URL: #24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: #20673
PR-URL: #24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: nodejs#20673
PR-URL: nodejs#24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
"That particular `emit('error', ...)` is largely defensively coded and
should not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: #20673
PR-URL: #24407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
"That particular
emit('error', ...)is largely defensively coded andshould not ever actually happen." Sounds like an assertion rather than
an error event. The code in question has no test coverage because it is
believed to be unreachable.
Fixes: #20673
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes