-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
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
Line 234 in 7a72784
| return null; |
External references such as API reference guides used
Line 234 in 7a72784
| return null; |
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;
}
}
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.