Thread view

Curious about the new %catches directive.
Say I have code like this:
%exception {
try {
$action
}
catch (geos::AssertionFailedException *e) {
%raise(SWIG_NewPointerObj(e,
SWIGTYPE_p_geos__AssertionFailedException, SWIG_POINTER_OWN),
"geos::AssertionFailedException",
SWIGTYPE_p_geos__AssertionFailedException);
}
catch (geos::IllegalArgumentException *e) {
%raise(SWIG_NewPointerObj(e,
SWIGTYPE_p_geos__IllegalArgumentException, SWIG_POINTER_OWN),
"geos::IllegalArgumentException",
SWIGTYPE_p_geos__IllegalArgumentException);
}
.....(skipping a few more exceptions)
I tried doing something like this instead:
%catches(geos::AssertionFailedException, geos::IllegalArgumentException)
Where this would apply to every generated method, just like the
%exception clause above. Didn't seem to work though - is this the
correct usage of %catches or is it intended to be used differently?
Thanks,
Charlie

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details