Skip to content

Commit 2b3196b

Browse files
Add error message to spanner failure logging
1 parent 0df4712 commit 2b3196b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<groupId>io.cdap.plugin</groupId>
2222
<artifactId>google-cloud</artifactId>
23-
<version>0.22.7</version>
23+
<version>0.22.8-SNAPSHOT</version>
2424
<name>Google Cloud Plugins</name>
2525
<packaging>jar</packaging>
2626
<description>Plugins for Google Big Query</description>

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

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

0 commit comments

Comments
 (0)