Processing JSON API Errors
Following the JSON API documentation around errors (http://jsonapi.org/format/#errors-processing), what's the best way to handle that?
eg: p = Person.find(999) is expecting an error like so:
{
"errors": [
{
"status": "404",
"detail": "Oh no, we could not find your friend!"
}
]
}
Instead, I'm receiving a nil. Is there a way to read the body of the response somewhere?
I have the same question. Did you find a solution?
what's the behavior you would expect here? you might be able to write a customized parser based on the JsonApiParser to do what you want.
Likely to raise an exception or return an object that has the errors
I'm having problems with this too. Since validations occur mainly on creating/updating to the database, I'm having trouble thinking about how to capture 404's when Her puts a GET request to a resource that doesn't exist. The code I work with sends back a 404 status, but I don't think Her is capturing that.