loganasherjones / yapconf

Yet Another Python Configuration
http://yapconf.readthedocs.io/en/stable/
MIT License
18 stars 4 forks source link

Add item name to exception as an attribute #21

Closed hazmat345 closed 6 years ago

hazmat345 commented 6 years ago

I'm trying to load a spec with a required item. If that item doesn't exist a YapconfItemNotFound is raised (as expected).

I'd like to wrap the load_config call and raise a nicer exception if that item is missing (I don't want the end user to need to know about Yapconf). It would be nice if that exception had the item that caused it as an attribute so I could easily reference it in the error message.