1

I am canceling Ajax requests in my adapter under certain circumstances (I referenced this answer when writing my code) and previously I had used the ajaxError hook (code below) to ignore 'abort' errors caused by aborting the Ajax requests. What I was doing was looking at the responseText and comparing it to 'abort', and if it was an 'abort', I ignored it so it didn't actually throw an error/show up in the console.

In Ember 1.13.9 though, I am of course getting a deprecation warning for ajaxError as it is going away. The problem is, I'm not sure what to use to do this now. I tried using handleResponse, but it looks like handleResponse never gets called if the request is aborted. It's possible I was doing something wrong, but I put a console.log in handleResponse and it never printed anything when the requests were canceled. Is handleResponse the right way to go, and am I missing something? If not, is there some other hook I can use?

ajaxError: function(jqXHR, responseText, errorThrown){
  if(responseText != 'abort'){
    this._super(jqXHR, responseText, errorThrown);
  }
}
Community
  • 1
  • 1

0 Answers0