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:
parent
1abc5c131b
commit
effe88404d
3 changed files with 12 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue