boolean (@NotNull UExpression expression) { final UCallExpression newExpression = UastUtils.getParentOfType(expression, UCallExpression.class, true, UBlockExpression.class, UClass.class); if (newExpression != null) { if (UastExpressionUtils.isConstructorCall(newExpression)) { UReferenceExpression classReference = newExpression.getClassReference(); if (classReference != null) { PsiClass cls = ObjectUtils.tryCast(classReference.resolve(), PsiClass.class); if (cls != null) { return InheritanceUtil.isInheritor(cls, CommonClassNames.JAVA_LANG_THROWABLE); } } } PsiMethod method = newExpression.resolve(); if (method != null) { if (method.isConstructor()) { return InheritanceUtil.isInheritor(method.getContainingClass(), CommonClassNames.JAVA_LANG_THROWABLE); } return ERROR_WRAPPER_METHODS.methodMatches(method); } } return false; }