Stop using SWIG_exception. It is flawed.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7343 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-07-22 21:33:32 +00:00
commit effe88404d
3 changed files with 12 additions and 9 deletions

View file

@ -8,14 +8,12 @@
%include exception.i
// containers
// methods which can raise are caused to throw an IndexError
%exception std::vector::get {
try {
$action
} catch (std::out_of_range& e) {
SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, const_cast<char*>(e.what()));
return $null;
}
}
@ -23,7 +21,8 @@
try {
$action
} catch (std::out_of_range& e) {
SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, const_cast<char*>(e.what()));
return $null;
}
}