Exception/Error division in D

Walter Bright newshound2 at digitalmars.com
Fri Jun 1 13:35:10 PDT 2012


On 6/1/2012 11:14 AM, deadalnix wrote:
> We are talking about runing scope statement and finally when unwiding the stack,
> not trying to continue the execution of the program.

Which will be running arbitrary code not anticipated by the assert failure, and 
code that is highly unlikely to be desirable for shutdown.

> This is, most of the time, the point of error/exceptions. You rarely recover
> from them in real life.

I believe this is a misunderstanding of what exceptions are for. "File not 
found" exceptions, and other errors detected in inputs, are routine and 
routinely recoverable.

This discussion has come up repeatedly in the last 30 years. It's root is always 
the same - conflating handling of input errors, and handling of bugs in the 
logic of the program.

The two are COMPLETELY different and dealing with them follow completely 
different philosophies, goals, and strategies.

Input errors are not bugs, and vice versa. There is no overlap.


More information about the Digitalmars-d mailing list