Program logic bugs vs input/environmental errors

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 12:38:09 PDT 2014


On Sunday, 28 September 2014 at 17:40:49 UTC, Walter Bright wrote:
>
> You can hook D's assert and do what you want with it.

With the caveat that you must finish by either exiting the app or 
throwing an exception, since the compiler doesn't generate a 
stack frame that can be returned from.

> Exceptions are meant for RECOVERABLE errors. If you're using 
> them instead of assert for logic bugs, you're looking at 
> undefined behavior. Logic bugs are not recoverable.

In a multithreaded program, does this mean that the thread must 
be terminated or the entire process?  In a multi-user system, 
does this mean the transaction or the entire process?  The scope 
of a logic bug can be known to be quite limited.  Remember my 
earlier point about Erlang, where a "process" there is actually 
just a logical thread in the VM.


More information about the Digitalmars-d mailing list