From 716449db7bada3e948a3bed83130598c385b98c8 Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Thu, 15 Feb 2024 16:51:05 +0000 Subject: [PATCH] add error code to spanner failure logging --- .../io/cdap/plugin/gcp/spanner/source/SpannerSource.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/cdap/plugin/gcp/spanner/source/SpannerSource.java b/src/main/java/io/cdap/plugin/gcp/spanner/source/SpannerSource.java index 00ccc7933f..ad03c023e9 100644 --- a/src/main/java/io/cdap/plugin/gcp/spanner/source/SpannerSource.java +++ b/src/main/java/io/cdap/plugin/gcp/spanner/source/SpannerSource.java @@ -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()); } }