private static String formatTypeSafe(PsiElement parent, PsiType type, int options, PsiSubstitutor substitutor) {
    try {
      return formatType(type, options, substitutor);
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (Throwable e) {
      if (ExceptionUtil.getRootCause(e) instanceof PsiInvalidElementAccessException) {
        throw new RuntimeException("Invalid type in " + parent.getClass(), e);
      }
      throw e;
    }
  }
private static String formatTypeSafe(PsiElement parent, PsiType type, int options, PsiSubstitutor substitutor)