Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error messages when an input can't be found #64

Open
derekprior opened this issue Mar 22, 2017 · 2 comments
Open

Better error messages when an input can't be found #64

derekprior opened this issue Mar 22, 2017 · 2 comments

Comments

@derekprior
Copy link

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?

@calebhearth
Copy link
Owner

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.

@hovsater
Copy link
Contributor

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? 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants