Template Function lsst::pex::exceptions::python::declareException

Function Documentation

template<typename T, typename E = lsst::pex::exceptions::Exception>
pybind11::class_<T, E> lsst::pex::exceptions::python::declareException(pybind11::module &mod, const std::string &name, const std::string &base)

Helper function for pybind11, used to define new types of exceptions.

While this function creates the class wrapper, the user is still responsible for adding all constructor and member wrappers to the returned py::class_ object.

Template Parameters
  • T: The C++ exception to wrap.

  • E: The C++ base class of T.

Parameters
  • [in] mod: Module to insert the exception into.

  • [in] name: Name of the exception in the module.

  • [in] base: Python name of base class (from pex::exceptions).