throw Exception with custom message in nogc code

poliklosio via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 5 03:47:44 PDT 2016


On Sunday, 5 June 2016 at 10:37:49 UTC, poliklosio wrote:
> Also, exceptions are not necessarily for bugs. There may be 
> used sometimes for bug handling when other things like static 
> typing and assertions are not enough, but bug handling is not 
> the core reason for havi ng exceptions in languages.

Actually, in D, things like assertions already behave like 
exceptions jumping up the call stack and generating stack traces 
so there should be no reason to ever use normal exceptions to 
handle programmer mistakes. I like this language a little bit 
more every day I use it.


More information about the Digitalmars-d-learn mailing list