From: Marcelo M. <mm...@ac...> - 2006-01-31 01:33:26
|
If you want to catch 'geos::IllegalArgumentException *' you have to ask for it, ie: %catches(geos::AssertionFailedException *, geos::IllegalArgumentException *) Marcelo Charlie Savage wrote: > 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 |