Hi all,
I am trying to return an error object from my api - for a situation, where for example there are no results returned for a query.
This is the type of error object I am returning:
{"errors":[{"status":"422"}]}
This complies with recommendation set out in jsonapi.org spec (I hope!)
The error I get back from ember when I go to a page which will generate such an error is
Error: Assertion Failed: Expected an object in the 'data' property in a call to 'push' for undefined, but was undefined
Any ideas much appreciated!
Using Ember 2.4.2, Ember Data 2.4.0
Update:
for a query which returns no results, I am now returning the json object with basic info eg id and type - that work ok. However, I am still having a problem when, for example there is a problem with the database connection and you want to be returning the error object. I am still get
Assertion Failed: Expected an object in the ‘data’ property in a call to ‘push’ for undefined, but was undefined
This is the json I am responding with:
{"errors":[{"status":"422","detail":"Problem with the database connection"}]}