[Raygun JS] How to only report jQuery AJAX errors with no error callback

bessey

Posted on
May 28 2015

I am using the Raygun JS library and finding its ability to catch 4xx/5xx jQuery AJAX responses incredibly useful.

However, I would like to NOT report AJAX responses of this nature if the response is handled by a .then(null, errorCallback) handler.

Is this possible?


bessey

Posted on
May 28 2015

To clarify I am using jQuery via Ember.js, but the principle still applies to straight jQuery, however the syntax may be slightly different. I've tried .error and .fail and neither have prevented the error from getting to Raygun :(


Callum

Posted on
May 28 2015

There's two flags for controlling this in the options object, which you can set to taste:

Raygun.init('apikey', {
  ignoreAjaxAbort: true,
  ignoreAjaxError: true
}).attach();

Most likely you will want the second one set to true at the least.


Reply