I've a jQuery ajax GET request which gives the server a clientId. When the clientId is invalid I return a 400 "Bad token etc...". This works great only I do not understand why jQuery throws this error in the console?
So my question is: "How can I stop jQuery from throwing and simply just call the error callback instead of both"
My code:
$.ajax({
type: type,
url: url,
timeout: 30000,
dataType: "text",
success: function (data, textStatus, jqXHR) {
callback(textStatus, url, jqXHR, data);
},
error: function (jqXHR, textStatus, errorThrown) {
callback(textStatus, url, jqXHR, errorThrown);
}
});