Align HikariDriverConfigurationFailureAnalyzer with latest Framework change

The Framework now throws a CannotGetJdbcConnectionException rather
than an IllegalStateException.
pull/9047/merge
Andy Wilkinson 8 years ago
parent c3e96d5122
commit f5da19f2db

@ -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;
}

Loading…
Cancel
Save