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

ODataStore and promise #2386

Closed
genusP opened this issue Jan 8, 2018 · 2 comments
Closed

ODataStore and promise #2386

genusP opened this issue Jan 8, 2018 · 2 comments
Assignees

Comments

@genusP
Copy link

genusP commented Jan 8, 2018

Use Devexreme and devextreme-angular 17.2.4

  1. Many methods in ODataStore return Promise. Returned instance not contains method catch
  2. I call method ODataStore.insert, if server response set http status 500 then returned promise not call any branch.
@GoshaFighten
Copy link

The catch event will be added in the next 17.2 version (17.2.5). See the Add "catch" method for Deferred utils pull request.

As for the second question, you can use the following code to handle errors in ODataStore:

var ds = new DataSource({
  store: {
    type: 'odata',
    url: 'http://www.example.com/dataservices/odata/targetData',
    key: 'Id'
  },
  paginate: false
})
ds.load().then(() => {
  alert("resolve");
}, () => {
  alert("fail");
});
ds.store().insert({id: 1}).then(() => {
  alert("resolve");
}, () => {
  alert("fail");
});

See the sample that illustrates this. If this approach does not work, please open a new Support Center ticket for the issue.

@genusP
Copy link
Author

genusP commented Jan 11, 2018

@GoshaFighten I use similar code. This problem actual for HTTP code 500, no calls for "resolve" and "fail"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants