It seems Method.invoke() does not pass on any exceptions from the invoked method.
So, even if I surround it with a try-catch block, any exceptions happening inside the invoked method will lead to an Unhandled Exception error and crash the app.
class Test {
function testInvoke() as Void {
try {
method( :callback ).invoke();
} catch ( ex ) {
// handle the exception
}
}
function callback() as Void {
// This leads to an Unhandled Exception error
throw new InvalidOptionException( "Test" );
}
}
What would you say, bug, feature, or am I just doing something wrong?