From: Hendrik Schober (boost_at_[hidden])
Date: 2002-06-20 12:02:44
"David Abrahams" <david.abrahams_at_[hidden]> wrote:
[my newsreader again mis-threaded your posting, which
is why I only saw it now]
> > I don't think it is more useful for the customer,
> > since are core dump usually also means that they
> > lost their work.
> assert() == abort() on failure
> or at least, that's what I thought you meant.
For me, a piece of code (an event handler) fails.
So there must be a bug in it. What can I say? With
the resources we have here, all our code has bugs.
Not a single user would pay for bug free software.
I simply have to live with the fact, that assertions
fail in shipped code. At customer's. Not on a daily
base, but they do fail once in a while.
My task was to deal with this, since developers
weren't asserting, because they shouldn't to abort
in the case of an error. So I did set up an 'ASSERT'
macro, which will throw a special exception.
As I said, that might stop the currently handled
event (e.g. print document etc.), throw a really
scary message onto the GUI, but it will allow the
user to proceed, if he/she wants to try to save
the last two hour's work.
> I didn't realize you were trying to recover from a failed assertion.
> Dangerous, but sometimes it's the only practical approach.
I'm not only a programmer, I am a user, too. And I
hate those messages that the OS not only slapped the
app I'm using onto it's fingers, but also killed it
right away. And I do appreciate to be told that
something really, really bad happened and that I
_should_ close the app and try again. And usually
I'll follow that advice. (Working on Windows for
years I got into the habit to constantly safe my work.)
> I was discussing the importance of having a stack tracing mechanism that
> wasn't dependent on exceptions. [...]
I see. Sorry for the misunderstanding.
> > Well, of course, once you have a portable/ported way
> > to get a call stack from any point of the program,
> > using this in the exceptions ctor would make a lot of
> > sense.
> Or, hopefully, from other places not involving exceptions...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk