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

getPackageDir raises RuntimeError instead of pex::exceptions::NotFoundError

    Details

    • Templates:
    • Story Points:
      1
    • Sprint:
      Alert Production S17 - 5
    • Team:
      Alert Production

      Description

      The documentation for utils.getPackageDir claims @throw lsst::pex::exceptions::NotFoundError if desired version can't be found, but it actually raises RuntimeError:

      In [1]: import lsst.utils
       
      In [2]: lsst.utils.getPackageDir('dajfsfsa')
      ---------------------------------------------------------------------------
      RuntimeError                              Traceback (most recent call last)
      <ipython-input-2-bac2a7aa8ca6> in <module>()
      ----> 1 lsst.utils.getPackageDir('dajfsfsa')
       
      RuntimeError: Package dajfsfsa not found
      

      We should either fix the docstring, or fix what is raised (likely at the pybind11 layer).

      We also need to fix the GetPackageDirTestCase unittest so that it tests against the correct exception being raised (it currently tests Exception, which is unhelpful).

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  Parejkoj John Parejko
                  Reporter:
                  Parejkoj John Parejko
                  Reviewers:
                  Nate Lust
                  Watchers:
                  Jim Bosch, John Parejko, Kian-Tat Lim, Krzysztof Findeisen, Nate Lust, Pim Schellart [X] (Inactive), Russell Owen, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel