You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instantiating the actual custom provider ClassAProvider, then calling its .get
doing a lot of work, part of it (4 stack frame bellow) is happening in ClassX, doing injector.getInstance for ClassB -> this fails with ConfigurationError
the ConfigurationError (with the relevant stacktrace) is discarded in .errorInUserCode, only its message is kept.
What did I observe?
A ProvisionException that talks about failing to provision ClassB, while provisioning ClassA via ClassAProvider. If you look into ClassAProvider construtor, you don't see any ties to ClassB. It does not mention that code of ClassX in anyway in the text or stacktrace.
You have to start debugging ClassAProvider / Guice itself to find out where is the nested Guice error happening / being discarded.
The text was updated successfully, but these errors were encountered:
There is a special case in InternalProvisionException.errorInUserCode
guice/core/src/com/google/inject/internal/InternalProvisionException.java
Lines 91 to 102 in e960b66
which has been pre-flagged as TODO by the author of the function (see git blame https://github.com/google/guice/blame/e960b66d3d5931b9cb1aebd49e452e2c489a921e/core/src/com/google/inject/internal/InternalProvisionException.java#L95) as a potential problem, and I was just hit by this - it indeed discard important context!
What was happening is there was:
What did I observe?
A ProvisionException that talks about failing to provision ClassB, while provisioning ClassA via ClassAProvider. If you look into ClassAProvider construtor, you don't see any ties to ClassB. It does not mention that code of ClassX in anyway in the text or stacktrace.
You have to start debugging ClassAProvider / Guice itself to find out where is the nested Guice error happening / being discarded.
The text was updated successfully, but these errors were encountered: