Align HikariDriverConfigurationFailureAnalyzer with latest Framework change
The Framework now throws a CannotGetJdbcConnectionException rather than an IllegalStateException.
This commit is contained in:
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…
Reference in New Issue