Skip to content

fix(dependency-injection): include requiredBy chain in UnsatisfiedDependencyException message#28

Merged
deer merged 1 commit intomainfrom
dep_exception_message
Apr 13, 2026
Merged

fix(dependency-injection): include requiredBy chain in UnsatisfiedDependencyException message#28
deer merged 1 commit intomainfrom
dep_exception_message

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented Apr 13, 2026

Previously, UnsatisfiedDependencyException only named the unsatisfied dependency itself. When a failure was buried several levels deep in the injection graph, there was no way to tell which top-level component triggered the resolution.

The requiredBy chain was already threaded through AbstractResolvable but never included in the exception message. This change walks the chain at throw time and appends it:

Unable to resolve com.example.DatabaseConnection:
  required by TaskExecutor
  required by DefaultProgram
  required by Engine

@deer deer merged commit bda50c9 into main Apr 13, 2026
1 check passed
@deer deer deleted the dep_exception_message branch April 13, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant