kalekundert / byoc

MIT License
0 stars 0 forks source link

Add an easy way to raise a custom exception if a parameter isn't found #33

Open kalekundert opened 2 years ago

kalekundert commented 2 years ago

The most straight-forward way to do this would be to add a picker that does what first() does, but raises a custom exception if the attribute can't be found.

However, this is a common enough need that it might be worth simplifying further. I could give param() an err argument, which would be the default exception to raise when a picker fails. I'd have to make this information available to the picker in the same way that metadata currently is.