Open alfredodeza opened 3 years ago
This can probably be broken down into a few different issues we can tackle as part of a milestone to cleanup.
I do not think, however, that this is something that can be done randomly or as part of other feature work/bug fixes. We'll need to divide up the code into sections and work thru it systematically since these changes will certainly cause potential regressions in control flow and user-facing error responses.
There is a wide-use of a Python exception handling anti-pattern in the code base. This anti-pattern looks like this:
This is problematic in many different ways:
try
part has usually more than one call and can have many lines. Alogger.info
will probably never cause an exception, and should not be caught. Catching exceptions should be done as targeted as possible.Exceptions are there to allow behavior changes and make logical decisions on what to do next. Broad exceptions do not allow that and forces this pattern everywhere else to suppress errors.
Although this is technically a "tech debt" problem - it has been raised before, and the issue is significant, so I'm going to add this as a "bug" category/label as well. It is pressing to address this problem.