From 003684b7fbb9cda5e2cee1066cb1f315a2fc0855 Mon Sep 17 00:00:00 2001 From: Maksymilian Pawlak Date: Fri, 8 Jun 2018 18:14:59 +0100 Subject: [PATCH] [ENT-1837] Better message, but retain original exception (#3330) * Retain original exception --- node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index e6a90d4379..f87174cfcc 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -1029,7 +1029,7 @@ fun configureDatabase(hikariProperties: Properties, return CordaPersistence(dataSource, databaseConfig, schemaService.schemaOptions.keys, attributeConverters) } catch (ex: Exception) { when { - ex is HikariPool.PoolInitializationException -> throw CouldNotCreateDataSourceException("Could not connect to the database. Please check your JDBC connection URL, or the connectivity to the database.") + ex is HikariPool.PoolInitializationException -> throw CouldNotCreateDataSourceException("Could not connect to the database. Please check your JDBC connection URL, or the connectivity to the database.", ex) ex.cause is ClassNotFoundException -> throw CouldNotCreateDataSourceException("Could not find the database driver class. Please add it to the 'drivers' folder. See: https://docs.corda.net/corda-configuration-file.html") else -> throw CouldNotCreateDataSourceException("Could not create the DataSource: ${ex.message}", ex) }