Skip to content

Commit

Permalink
add error code to spanner failure logging
Browse files Browse the repository at this point in the history
  • Loading branch information
itsankit-google committed Feb 15, 2024
1 parent 42f75fd commit 716449d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public void configurePipeline(PipelineConfigurer pipelineConfigurer) {
} catch (SpannerException e) {
// this is because spanner exception error message is not very user friendly. It contains class names and new
// lines in the error message.
collector.addFailure("Unable to connect to spanner instance.",
"Verify spanner configurations such as instance, database, table, project, etc.")
collector.addFailure(String.format(
"Unable to connect to spanner instance with error code: %s", e.getErrorCode().name()),
"Verify spanner configurations such as instance, database, table, project, etc.")
.withStacktrace(e.getStackTrace());
}
}
Expand Down

0 comments on commit 716449d

Please sign in to comment.