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

Refine pybind11 wrapping of custom exceptions

    Details

      Description

      pex_exceptions includes a nice C++ function for wrapping custom exceptions, however there are two minor issues with it:

      1. This function is not used to wrap the exceptions in pex_exceptions. Instead a more complicated and less safe procedure is used, one that defines C++ symbols and then shadows them with python symbols. Unfortunately this is the obvious place for users to go looking for examples of how to wrap exceptions, so this code really should be updated.
      2. The function does not define the standard constructor that takes a single std::string const &. The LSST macro that defines custom exceptions adds this constructor, so all LSST custom constructors have it. So I propose that the function add the constructor. Perhaps someday we will find a need to not add the constructor, but at that time we can add another function or a boolean flag that disables adding the constructor.

      I am assigning this to Pim Schellart [X] for now, at his request, but I am happy to do the work myself if he approves it as stated above.

        Attachments

          Container Issues

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rowen Russell Owen
                Watchers:
                Fred Moolekamp, Jim Bosch, Pim Schellart [X] (Inactive), Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel