injector icon indicating copy to clipboard operation
injector copied to clipboard

Make `MissingRequiredArgumentException` more friendly

Open vjik opened this issue 7 months ago • 0 comments

It would be nice to improve the MissingRequiredArgumentException - add a flag whether the Container is passed to the Injector.

And if the Container is not passed, and the argument being resolved is a class, then output a friendly message (FriendlyException) will be like "pass an object of the required type as an argument to invoke()/make() or pass a Container when creating the Injector"

If the Container parameter was set, then the friendly message will be like "add an object of the required type to the argument list or make sure that the configured Container can resolve it"

Originally posted by @roxblnfk in https://github.com/yiisoft/injector/issues/86#issuecomment-1864146016

vjik avatar Dec 20 '23 09:12 vjik