Proposal: Extensible exceptions

Chris Smith cdsmith at
Wed Jul 9 11:59:37 EDT 2008

Henning Thielemann wrote:
> If your program is buggy, then it may well be that the file to unlock is
> already unlocked and deleted.

I think you're being a tad too simplistic here.  In large software 
systems, you get different perspectives on the code.  From your module, 
that division by zero error may be fatal; but from my module, which may 
have been developed independently and is responsible for managing a 
number of other third party code modules, I would like to find out that 
your code had an error, note it in some kind of log, and then run the 
next person's code.  That is, from my code, your programming errors were 
entirely anticipated "external" things that could go wrong.

This sort of thing doesn't happen in all large software systems, but it's 
not exactly rare.  Even when it's not a requirement, it's often a good 
idea just in the name of robust programming.  A sufficiently large system 
is bound to have some bugs; and it's nice to be able to isolate their 
effects enough to continue with the functionality that works.  Depends on 
the situation.

So, given that the distinction between "error" and "exception" is not 
absolutely, but often just depends on your perspective (and I do take 
that as a given), I'd call it very broken to have different mechanisms 
for each.

Chris Smith

More information about the Libraries mailing list