Skip to content

Commit c3e82d9

Browse files
add error code to spanner failure logging
1 parent b9c7bc8 commit c3e82d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/io/cdap/plugin/gcp/spanner/source/SpannerSource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ public void configurePipeline(PipelineConfigurer pipelineConfigurer) {
130130
} catch (SpannerException e) {
131131
// this is because spanner exception error message is not very user friendly. It contains class names and new
132132
// lines in the error message.
133-
collector.addFailure("Unable to connect to spanner instance.",
134-
"Verify spanner configurations such as instance, database, table, project, etc.")
133+
collector.addFailure(String.format(
134+
"Unable to connect to spanner instance with error code: %s", e.getErrorCode().name()),
135+
"Verify spanner configurations such as instance, database, table, project, etc.")
135136
.withStacktrace(e.getStackTrace());
136137
}
137138
}

0 commit comments

Comments
 (0)