Skip to content

Commit d610cd7

Browse files
committed
Added details to SQL Exception
1 parent 194d78f commit d610cd7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

database-commons/src/main/java/io/cdap/plugin/db/source/AbstractDBSource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ public void configurePipeline(PipelineConfigurer pipelineConfigurer) {
124124
collector.addFailure("Unable to instantiate JDBC driver: " + e.getMessage(), null)
125125
.withStacktrace(e.getStackTrace());
126126
} catch (SQLException e) {
127-
collector.addFailure("SQL error while getting query schema: " + e.getMessage(), null)
128-
.withStacktrace(e.getStackTrace());
127+
String details = String.format("SQL error while getting query schema: Error: %s, SQLState: %s, ErrorCode: %s",
128+
e.getMessage(), e.getSQLState(), e.getErrorCode());
129+
collector.addFailure(details, null).withStacktrace(e.getStackTrace());
129130
} catch (Exception e) {
130131
collector.addFailure(e.getMessage(), null).withStacktrace(e.getStackTrace());
131132
}

0 commit comments

Comments
 (0)