Error in odata ajax call

Error in odata ajax call

I have an $.ajax call in one of my html page:

  1. var query = ODATA QUERY
  2. jQuery.ajax({ dataType: 'jsonp', url: query, jsonpCallback: 'callback', success: callback, ajaxError : errore }); function callback(result) { } function errore() {console.log("errore"); }

but if the query fails i get an errore in console (NetworkError: 400 Bad Request) but does not enter in the error function. Why?