[phobos] Calling abort() on unhandled exception

Michel Fortin michel.fortin at michelf.com
Fri Jul 30 10:36:28 PDT 2010


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.



-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list