Open quantummaiddeveloper opened 4 years ago
Test Idea.
I have encountered another case where this would help. I have a dummy InjectorConfiguration that denies injection of a specific dependency:
inline fun <reified T> InjectMaidBuilder.denyInjectionsOfType(clazz: Class<T>): InjectMaidBuilder {
return this.withCustomType(clazz) {
throw DependencyInjectionDeniedException(clazz)
}
}
The error message does not say who tried to get the denied dependency injected
de.quantummaid.injectmaid.InjectMaidException: Exception during instantiation of 'SqsClient'
using custom instantiation via 'SCRUBBED.DenyDependencyInjectorConfigKt$denyInjectionsOfType$1@6f901d62'
...
Caused by: de.builderrahmen.examples.counter.sum.internal.infra.di.DependencyInjectionDeniedException:
software.amazon.awssdk.services.sqs.SqsClient
(no indication of what class was being injected)
Do you have an idea to improve the project? Please describe. Exceptions should tell why a type is needed for injection.
Compelling example where the user has no clue what's wrong where
Is your feature request related to a problem? Please describe. It is not always obvious what top-level registered type caused another type to be registered.
Describe the solution you'd like A stack-trace like visualization of the dependency tree that lead to the registration of a type (see MapMaid).