Catching Errors

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 19 06:29:46 PST 2017


 From what I understand, the difference between an Exception and 
and Error is that Errors signal your program has entered into an 
invalid state. For example, going past the end of an array and 
attempting to access that memory. On the flip side, Exceptions 
signal that something out of the ordinary happened, but with 
proper handling the program can go on it's merry way. An example 
being entering 13 as a month in a std.datetime.Date.

If this is the case, would it not make sense to make it illegal 
to catch Errors in @safe code?


More information about the Digitalmars-d mailing list