On Saturday, April 28, 2012 06:06:35 PM Dennis Victorovich wrote:
> Hi everyone.
> 
> Please correct me if i'm wrong, but currently shiboken doesn't have a
> mechanism for handling C++ code that throws exceptions.

You are right, PySide doesn't support exception translation.
 
> We've tackle this problem within our project and workaround is not really
> pretty (a bunch of extra code with try/catch and boost::bind).
> 
> Anyone have a bright ides how to solve the problem?
> I've created suggestion for improvement
> https://bugreports.qt-project.org/browse/PYSIDE-62.

You need to implement this feature on the Generator itself, I would separate 
this in two steps:

1. Do not translate anything, just catch all C++ exception and throw a Python 
RunTimeException.
2. Think about a way to specify a exception translation mechanism in the 
typesystem.

The step 1 will require some changes in the generator, the generator code 
isn't trivial, besides being a bit ugly due to the bad API of ApiExtractor but 
IMO you must try to hack the generator and implement this feature.
 
> Best regards.
> Dennis.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to