I used to do the same thing. Then, the error that spelled "This should never happen!" started to pop up. A couple of years after the original code was written.
Now, older and wiser, I include full stack trace and my explicit assumptions on all errors - orders of magnitude easier to debug than cryptic error messages. Treat your future self kindly !
Re:Someone left my Gmail in debug mode
by 72deluxe on Tuesday December 01, 2015 @08:09AM
(#10655011)
I put asserts in code for things that shouldn't happen. Sometimes I put them in debug mode only for friendlier behaviour.
Re:Someone left my Gmail in debug mode
by jakejake on Tuesday December 01, 2015 @03:14PM
(#10658399)
I usually have error logging/reporting with full stack trace. This was a quick one-off that I definitely didn't mean to commit! One web app that I worked on years ago would save the entire session state of the user on error. We had a dev tool that would allow us to jump in with all of our session state all set exactly as this user on the exact spot where they had the error. It was pretty great for reproducing most errors except one pesky one that would show up in the logs randomly.
Finally, one day I accidentally triggered that annoying error by doing a specific sequence of things and then clicking the browser back button a few times, then doing another specific sequence. That was a day of celebration!
I probably don't have to mention who got that alert while working one day. The president of the company, of course! Luckily for me it was not a customer-facing function & they found it funny.