를이 내 시나리오, 서로 다른 계층에서 같은 임의의 예외를 포함의 나는 예외 목록을 가지고 있고, 노호 코드 스냅 내가 어떻게 비교할 수 있습니다, 그래서비교 예외
private List<java.lang.Class> connectionExceptions;
try {
// trying to connect to external module;
} catch(Exception e) {
// Need to compare this exception e with a list of exceptions which I have,
// and the action depends on the results. There may be some other exception
// which are not in the list.
}
을해야 할 일을 설명 할 것 예외가 목록에 있거나 일부 다른 예외가있는 경우 어떤 종류의 작업이 필요합니다. ...
저는 제어 흐름이 예외적 인 것은 좋지 않음을 알고 있습니다. 그러나, 나는 그것을 할 필요가있다.
왜 'List'을 사용할 수 없습니까? –
KrishPrabakar