The extent of trust in errors and error handling

Dominikus Dittes Scherkl via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 6 01:09:31 PST 2017


On Monday, 6 February 2017 at 06:08:22 UTC, Chris Wright wrote:
> On Sat, 04 Feb 2017 23:48:48 -0800, Ali Çehreli wrote:
>> What I and many others who say Errors should not be caught are 
>> saying is, once the program is in an unexpected state, 
>> attempting to do anything further is wishful thinking.
>
> I've been thinking about this a bit more, and I'm curious: how 
> do you recommend that an application behave when an Error is 
> thrown?
It has lost its face and shall commit sucide.
That's the japanese way, and it has its merits.
Continuing to work and pretend nothing has happened (the european 
way) makes it just untrustworthy from the begining.
May be this is better for humans (they are untrustworthy anyway 
until some validation has been run on them), but for programs I 
prefer the japanese way.


More information about the Digitalmars-d mailing list