Skip to content

Commit eefee45

Browse files
add logging messages on error
1 parent 2aef3f6 commit eefee45

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sqldev/src/main/java/org/utplsql/sqldev/coverage/CodeCoverageReporter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,19 @@ public CodeCoverageReporter(final List<String> pathList, final List<String> incl
6161

6262
private void setConnection(final String connectionName) {
6363
if (connectionName == null) {
64-
throw new RuntimeException("Cannot initialize a CodeCoverageReporter without a ConnectionName");
64+
final String msg = "Cannot initialize a CodeCoverageReporter without a ConnectionName";
65+
logger.severe(() -> msg);
66+
throw new RuntimeException(msg);
6567
} else {
6668
try {
6769
// must be closed manually
6870
this.conn = Connections.getInstance()
6971
.cloneConnection(Connections.getInstance().getConnection(connectionName));
7072
} catch (ConnectionException e) {
73+
logger.severe(() -> "ConnectionException while setting connection: " + e.getMessage());
7174
throw new RuntimeException(e);
7275
} catch (DBException e) {
76+
logger.severe(() -> "DBException while setting connection: " + e.getMessage());
7377
throw new RuntimeException(e);
7478
}
7579
}

0 commit comments

Comments
 (0)