Skip to content

Commit 6983aa2

Browse files
authored
BigQuery.getQueryResults no longer returns null on a 404 (#2469)
BigQuery.getQueryResults() returns a GetQueryResultsResponse, which should not be null even if a 404 was thrown. Returning a null results in BigQueryImpl.getQueryResults() throwing a NPE, which is less informative than a wrapped "Not Found" BigQueryException. This is similar to the behavior of BigQuery.query(), which returns a QueryResponse, and just bubbles up any exceptions, translated, without filtering for any particular exception. Resolves issue #2428.
1 parent d2419d4 commit 6983aa2

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,7 @@ public GetQueryResultsResponse getQueryResults(String projectId, String jobId,
385385
.setTimeoutMs(Option.TIMEOUT.getLong(options))
386386
.execute();
387387
} catch (IOException ex) {
388-
BigQueryException serviceException = translate(ex);
389-
if (serviceException.getCode() == HTTP_NOT_FOUND) {
390-
return null;
391-
}
392-
throw serviceException;
388+
throw translate(ex);
393389
}
394390
}
395391

0 commit comments

Comments
 (0)