[phobos] Calling abort() on unhandled exception

Michel Fortin michel.fortin at michelf.com
Thu Jul 29 19:26:41 PDT 2010


Le 2010-07-29 à 21:52, Sean Kelly a écrit :

> Huh, so the ObjC behavior is to print the exception and abort() too. 

Mostly. Actually, it seems it calls the C++ runtime's std::terminate, which in turns call a user-settable handler function which is abort() if you haven't changed it.


> Looks like good justification for doing it in D as well then. 


I think it's the right thing to do, for OSX at least.

Perhaps it could be useful if the programmer could substitute his own handler function (similar to what you can do with std::set_terminate in C++) if he wants to do something special (such as a core dump).

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





More information about the phobos mailing list