code: public static QueryConstructionException fromThrowable(Throwable cause) {
      return (cause instanceof QueryConstructionException)
                     ? (QueryConstructionException) cause
                     : new QueryConstructionException(cause);
    }
docs: Converts a Throwable to a QueryConstructionException. If the Throwable is a
  QueryConstructionException, it will be passed through unmodified; otherwise, it will be wrapped
  in a new QueryConstructionException.
  
  @param cause the Throwable to convert
  
  @return a QueryConstructionException