Environment details
- OS: Mac (10.13.6)
- Java version: 1.8.0_181
- google-cloud-java version(s): 1.52.0
Steps to reproduce
- n/a
- n/a
Stacktrace
n/a
Code snippet
External references such as API reference guides used
Any additional information below
When a table is not found, null is returned instead of the actual HTTP code and BigQuery error message. This makes debugging much harder and is not intuitive for clients calling this method that null is actually returned when the table is not found. Instead, the exception should be propagated back up to the client so it can be handled accordingly.
@Override
public Table getTable(String projectId, String datasetId, String tableId,
Map<Option, ?> options) {
try {
return bigquery.tables()
.get(projectId, datasetId, tableId)
.setFields(Option.FIELDS.getString(options))
.execute();
} catch (IOException ex) {
BigQueryException serviceException = translate(ex);
if (serviceException.getCode() == HTTP_NOT_FOUND) {
return null;
}
throw serviceException;
}
}
Environment details
Steps to reproduce
Stacktrace
n/a
Code snippet
google-cloud-java/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
Line 234 in 7a72784
External references such as API reference guides used
google-cloud-java/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
Line 234 in 7a72784
Any additional information below
When a table is not found,
nullis returned instead of the actual HTTP code and BigQuery error message. This makes debugging much harder and is not intuitive for clients calling this method thatnullis actually returned when the table is not found. Instead, the exception should be propagated back up to the client so it can be handled accordingly.