public static <T> Failure<T> of(String errorMessage, Throwable throwable) {
    if (throwable == null || StringUtils.isBlank(errorMessage)) {
      throw new IllegalArgumentException("Error message cannot be null or empty");
    }
    StringWriter stringWriter = new StringWriter();
    try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
      throwable.printStackTrace(printWriter);
      return new Failure<>(errorMessage + "\n" + stringWriter);
    }
  }
Creates a {@link Failure} object containing the errorMessage

@param <T> the type of the result
@param errorMessage the error message describing the reason for failure.
@param throwable the throwable that caused the failure
@return an {@link Failure} instance containing the errorMessage
geode-core/src/main/java/org/apache/geode/services/result/impl/Failure.java