I was taught that good exception handing means:
- Don’t catch all exceptions -> only catch exceptions you know how to handle
- If your application needs to raise an exception, create a unique exception and raise it.
- Never silently ignore exceptions (it’s even part of the zen of python)
I strongly believe in these rules. they, in my opinion, make your code more readable, testable and easier to debug. Anyway, I just read a nice article with nice tips about exception handling.
By the way, I also add the locals (it’s really easy in python) of the exception I just raised. It helped a few times!