this.shell.getInterp().getContext().setProperty(RESULT, resultSet);
return resultSet.stream().map(result -> result.getObject()).iterator();
} catch (Exception ex) {
final Optional<ResponseException> inner = findResponseException(ex);
if (inner.isPresent()) {
final ResponseException responseException = inner.get();
if (responseException.getResponseStatusCode() == ResponseStatusCode.SERVER_ERROR_SERIALIZATION)
return String.format("Server could not serialize the result requested. Server error - %s. Note that the class must be serializable by the client and server for proper operation.", responseException.getMessage());
else
return responseException.getMessage();
} else if (ex.getCause() != null)
return ex.getCause().getMessage();
else
return ex.getMessage();
}