[dmd-internals] Throwing Errors

Jacob Carlborg doob at me.com
Mon Mar 12 13:13:28 PDT 2012


On 12 mar 2012, at 21:06, Alex wrote:

> It would be hard to write a framework around D unit tests, for
> instance, where you need to catch AssertErrors if things weren't
> cleaned up properly (or if it just called abort()). That's just the
> first thing that comes to mind.
> 
> Regards,
> Alex
> 


I completely agree. That's what I've been discussion in the "learn" newsgroup. I had a look through the source code of druntime and found "onAssertError". I don't know if it's used or not but sounds exactly like the function I need. But unfortunately the function to set the assert handler is deprecated. 

http://dlang.org/phobos/core_exception.html#onAssertError
http://dlang.org/phobos/core_exception.html#setAssertHandler

-- 
/Jacob Carlborg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20120312/3dd108de/attachment.html>


More information about the dmd-internals mailing list