Hi Kevin,
It is a bit complicated, maybe we can do better but... currently pool initialization occurs in one of two ways.
One: When the HikariDataSource is constructed.
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost:3306/simpsons");
config.setUsername("user");
config.setPassword("password");
HikariDataSource dataSource = new HikariDataSource(config);
In this case, the pool is initialized at the moment of HikariDataSource construction -- we have all of the configuration required to start the pool. Because constructors typically do not declare exceptions, an unchecked (Runtime) exception (PoolInitializationException) is thrown.
Two: When HikariDataSource.getConnection() is called.
HikariDataSource dataSource = new HikariDataSource();
dataSource.setJdbcUrl();
dataSource.setUsername("user");
dataSource.setPassword("password");
Connection connection = dataSource.getConnection();
In this case, when HikariConfig is not used and instead the HikariDataSource is configured directly, we do not know that configuration is complete until the user calls getConnection(). So, at the point of calling getConnection() the pool initialization is performed. Because the initialization logic is the same, the same PoolInitializationException is thrown. Note however, that calling getCause() on the PoolInitializationException should return the underlying database exception (in your case, MySQLSyntaxErrorException).
We could possibly catch PoolInitilizationException internally in this second case, and unwrap and throw the original exception...
Brett