Repository navigation
Distinguish between unsatisfied constructor and factory method deps - #965
Closed
wilkinsona wants to merge 1 commit into
Closed
wilkinsona wants to merge 1 commit into
wilkinsona wants to merge 1 commit into
Conversation
wilkinsona
force-pushed
the
diagnostics
branch
from
February 18, 2016 12:15
690f9d6 to
387ebb0
Compare
Previously, an UnsatisfiedDependencyException was thrown when the
dependencies (arguments) of a constructor or a factory method could not
be satisfied. This had two drawbacks:
1. The exception message for a failure for a factory method
mentioned constructor arguments.
2. The catcher of the exception had no way, short of parsing the
message, to determine the exact nature of the failure.
This commit introduces two new UnsatisfiedDependencyException
subclasses – UnsatisfiedFactoryMethodDependencyException and
UnsatisfiedConstructorDependencyException. Each new exception provides
getters to access the method or constructor, and the index and type
of the unsatisfied argument.
wilkinsona
force-pushed
the
diagnostics
branch
from
February 18, 2016 12:27
387ebb0 to
40a78d8
Compare
Member
|
@jhoeller has fixed this one already. Thanks for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed with @snicoll, and in support of Spring Boot 1.4's goal of providing improved diagnostics when application context refresh fails, this PR introduces specific exceptions for unsatisfied factory method dependencies and unsatisfied constructor dependencies.