Add feature director:except for improved director exception handling in Java
Closes #91
This commit is contained in:
parent
ec1d5a5be1
commit
6736e74127
12 changed files with 1469 additions and 51 deletions
|
|
@ -41,6 +41,29 @@ class DirectorMethodException: public Swig::DirectorException {};
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef SWIGJAVA
|
||||
|
||||
// Default for director exception warns about unmapped exceptions now in java
|
||||
// Suppress warnings for this older test
|
||||
// %warnfilter(476) Bar;
|
||||
|
||||
// Default for java is to throw Swig::DirectorException if no
|
||||
// direct:except feature. Since methods below have exception specification
|
||||
// cannot throw director exception.
|
||||
|
||||
// Change back to old 2.0 default behavior
|
||||
|
||||
%feature("director:except") {
|
||||
jthrowable $error = jenv->ExceptionOccurred();
|
||||
if ($error) {
|
||||
// Dont clear exception, still be active when return to java execution
|
||||
// Essentially ignore exception occurred -- old behavior.
|
||||
return $null;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SWIGRUBY
|
||||
|
||||
%feature("director:except") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue