auraphp / Aura.Di

Dependency Injection System
MIT License
349 stars 63 forks source link

Better identification on Aura\Di\Exception\ReflectionFailure #73

Closed Grummfy closed 9 years ago

Grummfy commented 9 years ago

When you have a Aura\Di\Exception\ReflectionFailure exception you can't always understand why. So add some message :

pmjones commented 9 years ago

I agree that this would be useful. Any thoughts on how it should work?

Grummfy commented 9 years ago

Simply a message in the exception with what I explain before.

When you have a dependency failing, you need to understand what's builded (if possible where => a trace), what's wrong as detailed as possible, what's missing, what's been understand by Aura\Di.

So a message like this: Aura\Di try to build/instanciate/... [classname, setter, ...] but have failed. The issue could come from [...]

pmjones commented 9 years ago

There's a long history here, but let it suffice to say that the custom ReflectionFailure exception isn't really needed any more. However, I have to keep it for backwards compatibility. What I'm going to do is capture the real ReflectionException message and push it into the custom ReflectionFailure exception message. Then you'll see something like 'Class Foo does not exist'.

jeremykendall commented 9 years ago

YES YES YES YES

Grummfy commented 9 years ago

thanks