Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-20441

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

    Details

      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.

        Attachments

          Activity

          Hide
          tjenness 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
          tjenness 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
          Parejkoj 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
          Parejkoj 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:
              tjenness Tim Jenness
              Reporter:
              Parejkoj John Parejko
              Reviewers:
              John Parejko
              Watchers:
              Andy Salnikov, Jim Bosch, John Parejko, Nate Lust, Tim Jenness
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel