Recently I was fighting with a scenario where I was throwing an exception but couldn’t figure out why the exception was actually happening. I’ve created a much simpler example below to demonstrate what I learned during the process of solving this.
The simplified scenario is as follows: I have a Python Module that calls another module to do some work that is wrapped in a try/except. Code is shown below.
Here’s the problem: when I run the code, I throw the catch-all exception, but no details are available as to the reason why it is failing. In my real world situation, it caused a lot of head scratching as during my troubleshooting there was no obvious cause.