mmerickel / wired

A service locator implementation for Python.
https://wired.readthedocs.io
MIT License
17 stars 9 forks source link

Helpful error message when 'name=' is forgotten #44

Closed smsearcy closed 8 months ago

smsearcy commented 1 year ago

We've using pyramid-services and have had some occasions where developers forgot to specify name= when passing a factory name instead of a class/interface. That resulted in an AttributeError about a missing __dict__ that wasn't very helpful. To make that problem quicker/easier to diagnose I'm raising ValueError with a helpful error message when developer passes a string instead of a class to find_service().