pex_exceptions includes a nice C++ function for wrapping custom exceptions, however there are two minor issues with it:
- 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.
- 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.