3 ms·
And in the opposite direction: remember when you are writing error messages to include all the relevant details, and never ever write "this shouldn't happen" or
by dsr_ 8y ago
And in the opposite direction: remember when you are writing error messages to include all the relevant details, and never ever write "this shouldn't happen" or "document later".
- fhood 8y agoWhat about, log_panic("If we have somehow managed to hit this code path, this project if FUBAR. I would recommend giving up and starting over.")
- m_samuel_l 8y agoThat's annoying but fine as long as it's unique and you can grep it in the codebase.
- btschaegg 8y agoSomehow reminds me of Aliens: I say we take off and nuke the entire site from orbit. It's the only way to be sure. :-)
- pletnes 8y agoIf used correctly, «this should not happen» can be very useful, indicating e.g that the program is in some illegal state, as opposed to the input being incorrectly formatted.
- scarface74 8y agoEven if that’s the case, create a custom exception and embed in the custom exception object the actual exception.
- gpderetta 8y agoAssert