23 #include "pybind11/pybind11.h" 26 #include "lsst/pex/exceptions/Runtime.h" 27 #include "lsst/pex/exceptions/python/Exception.h" 29 namespace py = pybind11;
37 using lsst::pex::exceptions::python::declareException;
38 using lsst::pex::exceptions::DomainError;
39 using lsst::pex::exceptions::RuntimeError;
41 py::module::import(
"lsst.pex.exceptions");
43 py::module mod(
"exceptions");
46 auto clsFatalAlgorithmError = declareException<FatalAlgorithmError, RuntimeError>(
47 mod,
"FatalAlgorithmError",
"RuntimeError");
48 auto clsMeasurementError = declareException<MeasurementError, RuntimeError>(
49 mod,
"MeasurementError",
"RuntimeError");
50 auto clsPixelValueError = declareException<PixelValueError, DomainError>(
51 mod,
"PixelValueError",
"DomainError");
54 clsMeasurementError.def(py::init<std::string
const &,
56 "message"_a,
"flagBit"_a);
59 clsMeasurementError.def(
"getFlagBit", &MeasurementError::getFlagBit);
PYBIND11_PLUGIN(exceptions)