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
// Wrap an optional error callback with a fallback error event.varwrapError=function(model,options){varerror=options.error;options.error=function(model,resp,options){if(error)error(model,resp,options);model.trigger('error',model,resp,options);};};
model.trigger(...) is expecting the model from wrapError arguments, but instead is model from options.error. We can see from ampersand-sync that the first argument is the response and not the model in this scenario:
// Make the request. The callback executes functions that are compatible// With jQuery.ajax's syntax.varrequest=options.xhr=xhr(ajaxSettings,function(err,resp,body){if(err&&options.error)returnoptions.error(resp,'error',err.message);
The text was updated successfully, but these errors were encountered:
the code in question:
model.trigger(...)
is expecting themodel
fromwrapError
arguments, but instead ismodel
fromoptions.error
. We can see from ampersand-sync that the first argument is the response and not the model in this scenario:The text was updated successfully, but these errors were encountered: