Skip to content

Commit 729e22f

Browse files
committed
improve error messaging
1 parent 861b397 commit 729e22f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

google/cloud/bigtable/internal/data_connection_impl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ class DefaultPartialResultSetReader
155155
// Throw an error when ExecuteQueryResponse returns metadata.
156156
if (response.has_metadata()) {
157157
final_status_ = internal::InternalError(
158-
"Response contains unknown type metadata", GCP_ERROR_INFO());
158+
"Expected results response, but received: METADATA",
159+
GCP_ERROR_INFO());
159160
operation_context_->PostCall(*context_, final_status_);
160161
return false;
161162
}

google/cloud/bigtable/internal/data_connection_impl_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3750,7 +3750,7 @@ TEST_F(DataConnectionTest, ExecuteQueryFailureWithSchemaChange) {
37503750
for (auto const& row : row_stream) {
37513751
EXPECT_THAT(row,
37523752
StatusIs(StatusCode::kInternal,
3753-
HasSubstr("Response contains unknown type metadata")));
3753+
HasSubstr("Expected results response, but received: METADATA")));
37543754
}
37553755
fake_cq_impl->SimulateCompletion(false);
37563756
}

google/cloud/bigtable/internal/partial_result_set_source.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ Status PartialResultSetSource::BufferProtoRows() {
211211
auto const& proto_values = proto_rows_.values();
212212

213213
if (columns_size == 0 && !proto_values.empty()) {
214-
return internal::InternalError("columns cannot be empty",
215-
GCP_ERROR_INFO());
214+
return internal::InternalError(
215+
"ProtoRows has values but ResultSetMetadata columns cannot be empty",
216+
GCP_ERROR_INFO());
216217
}
217218
if (proto_values.size() % columns_size != 0) {
218219
state_ = State::kFinished;

0 commit comments

Comments
 (0)