You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this example from the guides, I would expect the error to be caught as reason (since "/some/remote/data.json" is obviously invalid):
var ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin);
var proxy = ObjectPromiseProxy.create({
promise: Ember.$.getJSON('/some/remote/data.json')
});
proxy.then(function(json) {
// the json
}, function(reason) {
// the reason why you have no json
});
Instead, the full error message is printed to the console, as well as Uncaught [object Object]. Is this documentation out of date, or is there an issue with PromiseProxyMixin?
Another related issue is that using the following code instead yields the error Uncaught TypeError: proxy.then(...).catch is not a function:
proxy.then(function(json) {
// the json
}).catch(function (reason) {
// the reason why you have no json
});
@cklimkowsky I think this is because Ember.$.getJSON() does not return a ECMA specified promise, it's going to return a jquery Defered which is non-spec compliant. You should cast the jQuery deferred to a spec compliant promise.
Using this example from the guides, I would expect the error to be caught as
reason
(since "/some/remote/data.json" is obviously invalid):Instead, the full error message is printed to the console, as well as
Uncaught [object Object]
. Is this documentation out of date, or is there an issue withPromiseProxyMixin
?Another related issue is that using the following code instead yields the error
Uncaught TypeError: proxy.then(...).catch is not a function
:Guide for reference:
http://emberjs.com/api/classes/Ember.PromiseProxyMixin.html
I'm using Ember 2.6.0, and encountered the same issues at https://ember-twiddle.com/
The text was updated successfully, but these errors were encountered: