formulaic icon indicating copy to clipboard operation
formulaic copied to clipboard

Better error messages when an input can't be found

Open derekprior opened this issue 8 years ago • 2 comments

I love the way formulaic makes my specs read when everything is working, but when I use its DSL and I'm missing some translations or I don't have the parameters quite right, it can be frustrating to figure out why. I find myself source diving formulaic to reverse engineer what went wrong.

I wonder if the InputNotFound error could be improved to return a list of inputs that were found?

derekprior avatar Mar 22 '17 00:03 derekprior

I think it would be difficult. https://github.com/thoughtbot/formulaic/blob/00a6dac895497315e76f61369ac5d0de81afd687/lib/formulaic/inputs/string_input.rb#L4-L14 illustrates how we get around to raising InputNotFound. To build up a list of potential string inputs that were found, we'd need to combine the output of each of those to get a set of found inputs.

If you'd like to take a whack at it, I'm willing to merge something.

calebhearth avatar Mar 22 '17 01:03 calebhearth

I'd be up for pairing on this as well since I find myself in the same position as @derekprior more often that I'd like too. Would that be of interest? 😃

hovsater avatar Mar 22 '17 08:03 hovsater