Catch non-std::exceptions in PythonQtCallSlot
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hey Florian,
I have seom "problems" with non-std::exceptions in PythonQtCallSlot. I know that it is not possible for you to catch non-std::exception with the correct message, but you can catch all other exception with a default message instead of a crash from the application (because no one is catching it). The fix is really simple.
SVN revision 446, PythonQtSlot.cpp
existing code Line 203
Patched code:
The catch(...) will catch all other exception with a default message, which is enough to be able to catch the exception in the py-script. The scripter will get a default message, but he/she is able to catch it in script instead of a crash.
Hope you like the "patch"
Greetings
Tonka
I added a catch (...) which is enabled by default.
It can be disabled in the src.pro file by undefining PYTHONQT_CATCH_ALL_EXCEPTIONS.
Nice. Thx