Many times I want to execute a block of code which does something, but not something important. If I'm writing some important piece of software, I don't want problems in unimportant code areas bubbling up to cause big problems in areas that *are* important. This can be managed by writing great code, having an entire bureacracy of test scripts and good defensive coding habits. Or you can just wrap the whole lot in a try statement and best practises be be blowed.
I've got this idea that there can be a middle ground -- a way of being able to protect your important code when it's live and being relied upon (other than by just not having errors happen) while not putting in kludge after kludge to keep the motor running.
The idea is, basically, that exception handling would be linked to the logging system, and that whether an exception was fatal or not would depend on the logging/debug level set.
For example, I might have a code loop which is something like the following:
print "Sorry, there is no wheat in the hopper"
log("Something not very important broke unexpectedly")
if logLevel = "soft":
log('soft exceptions, see traceback')
This code would
a) Protect the important code in the loop
b) Respond to known failure modes
c) Log everything
d) Re-raise unexcpected exceptions if in debug mode
e) Suppress unimportant things if in operational/critical mode
I could even imagine "fallback mode' operations which could be user-enabled which would enable hard exception handling....
Just some thoughts....