devour-client icon indicating copy to clipboard operation
devour-client copied to clipboard

If there are no server errors, nothing is returned

Open nicolechung opened this issue 8 years ago • 0 comments

https://github.com/twg/devour/blob/master/src/middleware/json-api/res-errors.js#L5

If the JSON is accidentally malformed according to the JSONAPI spec, the error is not returned, the Logger just returns "Unidentified Error" in the console.

But if you step through dev tools there will be an error revealed:

Error: The JSON API response had a type of "X" but Devour expected the type to be "Y". at JsonApi.resource.

It would be helpful if instead of Unidentified Error it returned an ERROR and also something helpful like Your JSON is possibly not formed correctly.

nicolechung avatar Feb 08 '18 13:02 nicolechung