git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
54 lines
669 B
OpenEdge ABL
54 lines
669 B
OpenEdge ABL
%module exception_order
|
|
|
|
%include "exception.i"
|
|
|
|
/*
|
|
last resource, catch everything but don't override
|
|
user's throw declarations.
|
|
*/
|
|
|
|
%exception {
|
|
try {
|
|
$action
|
|
} catch(...) {
|
|
SWIG_exception(SWIG_RuntimeError,"postcatch unknown");
|
|
}
|
|
}
|
|
|
|
|
|
%inline %{
|
|
struct E1
|
|
{
|
|
};
|
|
|
|
struct E2
|
|
{
|
|
};
|
|
|
|
struct E3
|
|
{
|
|
};
|
|
|
|
struct A
|
|
{
|
|
/* caught by the user's throw definition */
|
|
int foo() throw(E1)
|
|
{
|
|
throw E1();
|
|
return 0;
|
|
}
|
|
|
|
int bar() throw(E2)
|
|
{
|
|
throw E2();
|
|
return 0;
|
|
}
|
|
|
|
/* caught by %postexception */
|
|
int foobar()
|
|
{
|
|
throw E3();
|
|
return 0;
|
|
}
|
|
};
|
|
%}
|