private static boolean hasJavaLangErrorType(PsiType type) {
      if (type instanceof PsiDisjunctionType disjunctionType) {
        for (PsiType disjunction : disjunctionType.getDisjunctions()) {
          if (hasJavaLangErrorType(disjunction)) {
            return true;
          }
        }
      }
      else if (type instanceof PsiClassType classType) {
        final PsiClass aClass = classType.resolve();
        if (InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_LANG_ERROR) &&
            !InheritanceUtil.isInheritor(aClass, "java.lang.ThreadDeath")) {
          return true;
        }
      }
      return false;
    }
private static boolean hasJavaLangErrorType(PsiType type)