# catch-all exceptions in gen3 butler should use raise from

XMLWordPrintable

#### Details

• Type: Bug
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
0.5
• Sprint:
Arch 2019-07-29
• Team:
Architecture

#### Description

While debugging some changes I made related to the new astrometry code, I tripped over the except Exception as e: at posixDatastore.py::309, which swallows the initial exception. This, and any other such broad exception catching in daf_butler should use raise from exception chaining, so that the original exception information does not get lost.

#### Activity

Hide
Tim Jenness added a comment -

Added some that are missing. I do wonder if the ones from getStoredFileInfo shouldn't be using from None instead of from e since the original exception really is irrelevant.

Show
Tim Jenness added a comment - Added some that are missing. I do wonder if the ones from getStoredFileInfo shouldn't be using from None instead of from e since the original exception really is irrelevant.
Hide
John Parejko added a comment -

Thanks for doing this. I'm not sure what to do in that specific case you mention: I'll leave it to your discretion.

Show
John Parejko added a comment - Thanks for doing this. I'm not sure what to do in that specific case you mention: I'll leave it to your discretion.

#### People

Assignee:
Tim Jenness
Reporter:
John Parejko
Reviewers:
John Parejko
Watchers:
Andy Salnikov, Jim Bosch, John Parejko, Nate Lust, Tim Jenness