Replies: 3 comments
-
@yurivict Do you have a minimal example? We can't replicate this and we even have testing to ensure the proper string is passed to Python when it is thrown: pybind11/tests/test_exceptions.py Line 10 in fcb5554 |
Beta Was this translation helpful? Give feedback.
-
I'm observing this on MacOS 12 on an M1 chip. Tried with both |
Beta Was this translation helpful? Give feedback.
-
A year ago, I did not have this problem, but I am also observing it now on my Intel-based MacOS system. |
Beta Was this translation helpful? Give feedback.
-
When C++ code throws a std::runtime_error exception python catches it as
RuntimeError
that prints asCaught an unknown exception!
The documentation says that a variety of STL exceptions is caught and converted to Python exceptions, but
std::runtime_error
isn't listed there.I have 2 questions:
(1) Why isn't
std::runtime_error
listed as a handled exception type?(2) Why isn't
std::runtime_error
processed as an instance ofstd::exception
properly?Beta Was this translation helpful? Give feedback.
All reactions