diff --git a/_pyceres/core/solver.h b/_pyceres/core/solver.h index 35de604..dc25ac0 100644 --- a/_pyceres/core/solver.h +++ b/_pyceres/core/solver.h @@ -66,7 +66,12 @@ void BindSolver(py::module& m) { py::classh PyOptions(m, "SolverOptions"); PyOptions.def(py::init<>()) .def(py::init()) - .def("IsValid", &Options::IsValid) + .def("IsValid", + [](const Options& self) { + std::string error; + bool valid = self.IsValid(&error); + return std::make_pair(valid, error); + }) .def_property( "callbacks", [](const Options& self) { return self.callbacks; },