如何捕获除特定异常之外的所有异常?
是否可以捕获方法的所有异常,但应引发的特定异常除外?
void myRoutine() throws SpecificException {
try {
methodThrowingDifferentExceptions();
} catch (SpecificException) {
//can I throw this to the next level without eating it up in the last catch block?
} catch (Exception e) {
//default routine for all other exceptions
}
}
/旁注:标记的“重复”与我的问题无关!