Broaden caught exceptions (#1985)
Handle BeanCreationException instead of just BeanCurrentlyInCreationException. This handles the case when a cyclic reference (causing a BeanCurrentlyInCreationException) occurs further down the line - when it is not the actuator of that references the in-creation HttpTracing bean, but a dependency of that actuator. In this case the exception that bubbles up here is an UnsatisfiedDependencyException, which is a BeanCreationException
This commit is contained in:
@@ -23,7 +23,7 @@ import java.util.StringJoiner;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.BeanCurrentlyInCreationException;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
|
||||
import org.springframework.boot.actuate.autoconfigure.web.server.ConditionalOnManagementPort;
|
||||
@@ -83,7 +83,7 @@ class SkipPatternConfiguration {
|
||||
}
|
||||
return () -> result;
|
||||
}
|
||||
catch (BeanCurrentlyInCreationException e) {
|
||||
catch (BeanCreationException e) {
|
||||
// Most likely, there is an actuator endpoint that indirectly references an
|
||||
// instrumented HTTP client.
|
||||
return () -> consolidateSkipPatterns(patterns);
|
||||
|
||||
Reference in New Issue
Block a user