grouplens/grapht — pull request #93 by elehack (2014-04-09 16:31:08+00:00)
Title: Error reporting improvements

This makes several changes to the injection exception.

One significant change: we now catch specific exceptions on reflection operations rather than `Exception`. It is my understanding that runtime exceptions thrown by the invoked method or constructor should be wrapped in an `InvokationTargetException`. These specific exceptions make it easier to provide more descriptive high-level exceptions.

I also added a `NullComponentException`, extending `InjectionException`, to allow us to detect missing components for better error reporting.

Still outstanding potential changes:

- Make `InjectionException` checked (I have sent an e-mail about this)
- Make the class and provider class satisfactions throw either `SolverException` or `IllegalArgumentException` for uninstantiable classes. Right now, their use of `InjectionException` throws the wrong exception (since they are instantiated at resolution time, not injection time), and results in ambiguous use of the type field on `InjectionException`.