Align HikariDriverConfigurationFailureAnalyzer with latest Framework change

The Framework now throws a CannotGetJdbcConnectionException rather
than an IllegalStateException.
This commit is contained in:
Andy Wilkinson 2017-06-09 12:38:07 +01:00
parent c3e96d5122
commit f5da19f2db
1 changed files with 5 additions and 4 deletions

View File

@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.jdbc;
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.jdbc.CannotGetJdbcConnectionException;
/**
* An {@link AbstractFailureAnalyzer} that performs analysis of a Hikari configuration
@ -26,14 +27,14 @@ import org.springframework.boot.diagnostics.FailureAnalysis;
* @author Stephane Nicoll
*/
class HikariDriverConfigurationFailureAnalyzer
extends AbstractFailureAnalyzer<IllegalStateException> {
extends AbstractFailureAnalyzer<CannotGetJdbcConnectionException> {
private static final String EXPECTED_MESSAGE = "cannot use driverClassName and "
+ "dataSourceClassName together.";
private static final String EXPECTED_MESSAGE = "Failed to obtain JDBC Connection:"
+ " cannot use driverClassName and dataSourceClassName together.";
@Override
protected FailureAnalysis analyze(Throwable rootFailure,
IllegalStateException cause) {
CannotGetJdbcConnectionException cause) {
if (!EXPECTED_MESSAGE.equals(cause.getMessage())) {
return null;
}