Stop using SWIG_exception. It is flawed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7343 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
14dd70ca4f
commit
c563916ddb
3 changed files with 12 additions and 9 deletions
|
|
@ -12,7 +12,8 @@
|
||||||
try {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} catch (std::out_of_range& e) {
|
||||||
SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpIndexOutOfRangeException, const_cast<char*>(e.what()));
|
||||||
|
return $null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -20,7 +21,8 @@
|
||||||
try {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} catch (std::out_of_range& e) {
|
||||||
SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpIndexOutOfRangeException, const_cast<char*>(e.what()));
|
||||||
|
return $null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
try {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -20,7 +21,8 @@
|
||||||
try {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,12 @@
|
||||||
|
|
||||||
%include exception.i
|
%include exception.i
|
||||||
|
|
||||||
// containers
|
|
||||||
|
|
||||||
// methods which can raise are caused to throw an IndexError
|
|
||||||
%exception std::vector::get {
|
%exception std::vector::get {
|
||||||
try {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} 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 {
|
try {
|
||||||
$action
|
$action
|
||||||
} catch (std::out_of_range& e) {
|
} 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