Skip to content

Commit 008f3a8

Browse files
Merge pull request data-integrations#1378 from data-integrations/improve-spanner-logging
[PLUGIN-1748] Add error code to spanner failure logging
2 parents 42f75fd + 716449d commit 008f3a8

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)