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.
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.