Python has the except:
clause, which catches all exceptions.
Since every error in Python raises an exception, this makes many
programming errors look like runtime problems, and hinders
the debugging process.
The following code shows a great example:
try: foo = opne("file") # misspelled "open" except: sys.exit("could not open file!")
The second line triggers a NameError which is caught by the
except clause. The program will exit, and you will have no idea that
this has nothing to do with the readability of "file"
.
There are some situations in which the except:
clause is useful:
for example, in a framework when running callbacks, it is good not to
let any callback disturb the framework.