メソッドが Method.invoke メソッドから呼び出されたときに、コードで例外をキャッチできないようです。メソッド自体の内部からどのようにキャッチできますか?
void function() {
try {
// code that throws exception
}
catch( Exception e ) {
// it never gets here!! It goes straight to the try catch near the invoke
}
}
try {
return method.invoke(callTarget, args);
}
catch( InvocationTargetException e ) {
// exception thrown in code that throws exception get here!
}
ありがとう!