Here is my problem:
I have two C ++ modules, A and B, which are built as dynamically linked libraries. A offers basic math functions and custom exception types. B is a higher level module that uses A.
B :: someFunction () calls a function from A and tries to catch its own exception A: MyExceptionFromA to convert it to a custom type B: MyExceptionFromB (since users of module B do not need to know about the implementation of detail A).
Everything works fine as long as I stay in the C ++ domain. However, if I expose B :: someFunction () in python via boost python, the exception no longer gets into the C ++ module.
I can catch the std :: runtime_error from which A: MyExceptionFromA is raised and call typeid (e) .name () to get the correct malformed name, so I know the right exception has been thrown. Therefore, I suspect that the problem is resolving this garbled character to the correct type of exception.
I found this link explaining that "python uses the [island] model to open extension modules so that authors of extension modules do not need to know which characters other extension modules can use." I suspect this is part of the problem / solution, but I don't know enough about character resolution to figure out how to solve my problem.
Any ideas?
source share