jsonapi-datastore icon indicating copy to clipboard operation
jsonapi-datastore copied to clipboard

Add payload error parsing

Open buren opened this issue 9 years ago • 1 comments

First of all thank you for this package :+1: :star:

This is by no means ready.. Just thought it could act as a starting point for discussing how errors could be handled.

With this approach every time a POST or PATCH response it synced the consumer must write something like this..

var article = store.sync(payload);
if (article.errors) {
  // error handling
} else {
  // handle successful response
}

@beauby what do you think? Should errors be handled in some other way?

buren avatar Apr 02 '16 15:04 buren

Hi @buren – sorry for the super-long delay. I really like the idea, although the API would have to be a bit different as the spec does not, AFAIK, forbid a field to be named errors, which would create a name clash.

beauby avatar Oct 21 '16 01:10 beauby