[phobos] Calling abort() on unhandled exception

Andrei Alexandrescu andrei at erdani.com
Fri Jul 30 16:14:56 PDT 2010


Michel Fortin wrote:
> Le 2010-07-30 à 11:29, Sean Kelly a écrit :
> 
>> Another alternative is deriving all exceptions that shouldn't show a trace by default from an exception with a custom toString that omits this info. 
> 
> I think we already have one: the OwnerTermianted exception. We could use another "normal termination" exception meant to terminate the program. The advantage over calling exit(-1) directly is that it'll honor destructors, finally clauses, and scope(exit) statements.
> 
> Upon catching this exception at main()'s termination, the runtime could print its message but omit the stack trace.

This doesn't work. A script could end with virtually any exception.

Andrei



More information about the phobos mailing list