> My reaction to 'the test fails because map::at threw an exception': stupid STL!!
> A core dump would be so much easier to analyze..
Uncaught exceptions call terminate(), which by default calls abort(), which generates a core dump. So if you want a core dump, just avoid catching the exception.
Except that I didn't put all these "catch"..
But you're right, that's what should be done (or at least, rethrowing the exception from the catch block).
Re:You’re better off using Exceptions
by AstralStorm on Tuesday February 04, 2020 @11:57AM
(#22237897)
C++ can have a stack trace, there are enough libraries providing this functionality and even compiler extensions. Say, libunwind, though you will have to demangle names.
And a debugger will see the stack as it is.
Also works in C.
Which makes exception in C++ a very, very bad idea!
My reaction to 'the test fails because map::at threw an exception': stupid STL!!
A core dump would be so much easier to analyze.. Gdb's 'catch thow' is wonderful (well, it is after I fixed the part of our codebase which use exceptions as a control flow mechanism)