Replies: 1 comment
-
Figured it out, had to expose // create an Error class which is really just std::error_code
py::class_<std::error_code>(m, "Error")
.def(py::init<>())
.def("__repr__", [](const std::error_code &self) {
return fmt::format("Error({})", self.message());
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to bind a method which takes a
std::error_code&
argument, similar to the alternate paradigm some stl methods provide which arenoexcept
.The binding / build works fine, but at runtime in python I'm getting
I am including the following:
I've looked through the docs and the code at https://github.com/pybind/pybind11/tree/master/include/pybind11 but I'm not finding any additional includes that I might be missing which would make sense.
Beta Was this translation helpful? Give feedback.
All reactions