HandlePlace (@NotNull PsiTryStatement tryStatement, @NotNull PsiClassType exceptionType) { // if finally block completes abruptly, exception gets lost PsiCodeBlock finallyBlock = tryStatement.getFinallyBlock(); if (finallyBlock != null && blockCompletesAbruptly(finallyBlock)) return HandlePlace.UNKNOWN; final PsiParameter[] catchBlockParameters = tryStatement.getCatchBlockParameters(); for (PsiParameter parameter : catchBlockParameters) { PsiType paramType = parameter.getType(); if (paramType.isAssignableFrom(exceptionType)) return new HandlePlace.TryCatch(tryStatement, parameter); } return HandlePlace.UNHANDLED; }