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

Add payload error parsing #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add payload error parsing #30

wants to merge 1 commit into from

Conversation

buren
Copy link

@buren buren commented Apr 2, 2016

First of all thank you for this package πŸ‘ ⭐

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?

@beauby
Copy link
Owner

beauby commented Oct 21, 2016

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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants