code: public static <T> IQueryResult<T> errorResult(Throwable exception) {
          return packageResult(null, CompletionStatus.ERROR,
              exception == null ? null : Collections.singletonMap("exception", (Object) exception));
      }
docs: Returns a query result for an error.
  
  @param <T> Class of query result.
  @param exception The exception being reported.
  @return Query result.