How to handle ember data transaction errors?

How do I know when a transaction failure has completed?

var obj = App.store.findAll(App.Todo).get('firstObject'); var t = App.store.transaction(); t.add(obj); obj.set('summary','New Summary'); t.commit(); // 403 or 401 is returned from the server (request failed) a.get('isLoading'); // true a.get('isError'); // false 

Use case: I want the user to see that his action (saving the object) failed.

+4
source share
1 answer

Indeed, to date, ember-data RESTAdapter data RESTAdapter not handle errors in commit requests.

You may be interested in the following PR , which offers error handling support.

+3
source

Source: https://habr.com/ru/post/1433826/


All Articles