We've got an interface we've defined in C++ (abstract class, all functions pure virtual) which will be extended in Python. To overcome the cross-language polymorphism issues we're planning on using SWIG directors. I've read how to catch exceptions thrown from C++ code in our Python code here, here, here, and even on SO.
It's fairly straight forward and I'm not expecting issues with handling our library's own exceptions. What I'd like to know and can't seem to find in the documentation is how to have our Python implementation of the extended C++ interface throw those C++ exceptions in a way that makes them visible to the C++ code.
We could make small functions within the *.i files such that each function throws our exceptions:
void throw_myException(){ throw MyException; }
but I'm wondering how it will interact with the Python code.
Anyone have any experience with throwing C++ exceptions from Python code?