假设我有下面的代码需要在不修改函数的情况下从匿名函数中抛出异常:
FOO.doSomething(new Transactable(){
public void run(FOO foo) {
// How to proxy a exception throw
// from here, without modifying the class
}
});
像:
@Override
public void run() throws MyCustomException{
FOO.doSomething(new Transactable(){
public void run(FOO foo) {
// How to proxy a exception throw
// from here, without modifying the class
}
});
}