Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Error handling #64
In the event a class' constructor throws an exception I think it would be better if that exception was thrown, not a DependencyException.
The code using the Container can more specifically target handling exceptions.
Most importantly this gives a more "honest" stack trace.
I see what you mean, I have merged locally your changes and proposed an alternative solution on #65.
Basically, I agree with you, except when it's a specific PHP-DI exception. Look at those 2 error message a user can get when getting an object from the container:
I find the first message not explicit enough.
So feel free to give your opinion on the new PR.
(btw if that's what you meant @domu1de currently exceptions are "chained", see line 77)