DIP33: A standard exception hierarchy

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Apr 4 19:42:39 PDT 2013


Thank you, I'd like to say I agree with you on this error should 
not run cleanup and your definition for when we don't want to run 
cleanup code is spot on. I'm also not looking to change the 
language spec. I'm still struggling with convincing myself that 
this thrown error more likely indicates a corrupt state than an 
exception.

This post will likely get long, I'm just hoping to articulate why 
I'm struggling to be in full agreement here.

On thing I keep thinking is, what about when I trying to 
write/read to the file and some code throws an Exception prior to 
the range access, cleanup would be run and no error in sight.

Then I think about, what if arrays threw an exception? Or why is 
it an error? Arrays make an agreement they will operate on valid 
input. If indexing outside the array then the operation "can't 
complete that task."

And to that, the reason arrays don't throw 
IndexOutOfBoundsException is because release will no longer check 
for that condition.

So I'm back to considering how come an RangeError has given a 
better indication that the program has entered an invalid state 
over getting an IOOBException.

What I've come to is that an Error makes an indication corruption 
has occurred more accurately than an Exception is because a 
program is expected never to hit an error, the only logical 
explanation is that either cosmic rays flipped some bits or 
another component of the program has overwritten this perfect 
section of code "I'm executing."

I think I'm satisfied with this. Thanks again.


More information about the Digitalmars-d mailing list