change the %catchs name to %catches

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8357 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-10 23:17:15 +00:00
commit a925249e0b
5 changed files with 31 additions and 18 deletions

View file

@ -17,10 +17,10 @@
/* The EmpytError doesn't appear in a throw declaration, and hence
we need to tell SWIG that the dequeue method throws it. This can
now be done via the %catchs feature. */
%catchs(EmptyError) *::dequeue();
%catches(EmptyError) *::dequeue();
/* What the catchs clause is doing under the covers is this:
/* What the catches clause is doing under the covers is this:
%exceptionclass EmptyError;
@ -28,11 +28,12 @@
try {
$action
} catch(EmptyError& e) {
// Create a new instance of the EmptyError, wrap it as a Ruby object that Ruby owns,
// and return it as the exception. For this to work EmtpyError must inherit from
// a standard Ruby exception class such as rb_eRuntimeError. SWIG automatically does
// this when the class is marked as %exceptionclass or is a throws specification.
%raise(SWIG_NewPointerObj(new EmptyError(e), SWIGTYPE_p_EmptyError, SWIG_POINTER_OWN), "EmptyError", SWIGTYPE_p_EmptyError);
// Create a new instance of the EmptyError, wrap it as a Ruby object that Ruby owns,
// and return it as the exception. For this to work EmtpyError must inherit from
// a standard Ruby exception class such as rb_eRuntimeError. SWIG automatically does
// this when the class is marked as %exceptionclass or is a throws specification.
%raise(SWIG_NewPointerObj(new EmptyError(e),SWIGTYPE_p_EmptyError, SWIG_POINTER_OWN),
"EmptyError", SWIGTYPE_p_EmptyError);
}
}
*/

View file

@ -15,7 +15,7 @@
}
}
%catchs(E1,E2*,ET<int>,ET<double>,...) A::barfoo(int i);
%catches(E1,E2*,ET<int>,ET<double>,...) A::barfoo(int i);
%inline %{