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

Make Grape::Exceptions full_messages public #1058

Closed
romanlehnert opened this issue Jul 8, 2015 · 3 comments
Closed

Make Grape::Exceptions full_messages public #1058

romanlehnert opened this issue Jul 8, 2015 · 3 comments

Comments

@romanlehnert
Copy link
Contributor

Grape::Exceptions::ValidationErrors#message currently joins the error messages together. Example:

"id is missing, name is missing"

However, when building custom error responses, that handle each single validation error separately, Grape::Exceptions::ValidationErrors#full_messages is extremely useful:

["id is missing", "name is missing"]

But this method is private. So my questions are

  • What do you think about making this method public?
  • Or is there a better way to access the single validation error messages?

Thanks!

@dblock
Copy link
Member

dblock commented Jul 8, 2015

I don't see a problem with making this method public. Write a spec for it and make a PR.

@romanlehnert
Copy link
Contributor Author

I'll do that. thanks.

@romanlehnert
Copy link
Contributor Author

Closing, since #1064 is merged.

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

2 participants