log.debug("Expected %s response from server but got %s: uri=%s, response=%s", PRESTO_PAGES_TYPE, contentType, request.getUri(), response);
return PagesResponse.createEmptyPagesResponse(token, nextToken);
}
try {
InputStreamSliceInput sliceInput = new InputStreamSliceInput(response.getInputStream());
return PagesResponse.createPagesResponse(token, nextToken, ImmutableList.copyOf(PagesSerde.readPages(sliceInput)));
}
catch (IOException e) {
throw Throwables.propagate(e);
}