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

Allow error! to support objects #13

Closed
aaronchi opened this issue Jan 9, 2011 · 3 comments
Closed

Allow error! to support objects #13

aaronchi opened this issue Jan 9, 2011 · 3 comments

Comments

@aaronchi
Copy link

aaronchi commented Jan 9, 2011

Most apis return some kind of error object when they return an error. It would be nice if grape supported any kind of input into the error! method and then parsed and returned it in the requested format

@mbleigh
Copy link
Contributor

mbleigh commented Jan 10, 2011

This is definitely something that will be on the roadmap. Because errors break the normal flow of things, they currently don't support any kind of formatting. Once they do, I'll make sure that if the message is an object, it is properly serialized instead.

@dblock
Copy link
Member

dblock commented May 8, 2011

This is implemented with #30. Now it can return JSON and if you hass a hash into error! it will render that.

 error!({ message => "access denied", detail => "user is missing the foobar privilege" }, 401)

@dblock
Copy link
Member

dblock commented Sep 2, 2011

I am closing this, please reopen if what's implemented is not sufficient.

@dblock dblock closed this as completed Sep 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants