code: public static QueryRuntimeException fromThrowable(String message, Throwable t) {
      return (t instanceof QueryRuntimeException && Objects.equals(message, t.getMessage()))
                     ? (QueryRuntimeException) t
                     : new QueryRuntimeException(message, t);
    }
docs: Converts a Throwable to a QueryRuntimeException with the specified detail message. If the
  Throwable is a QueryRuntimeException and if the Throwable's message is identical to the one
  supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a
  new QueryRuntimeException with the detail message.
  
  @param t       the Throwable to convert
  @param message the specified detail message
  
  @return a QueryRuntimeException