Distinguish between different reasons for failed AJAX requests

Distinguish between different reasons for failed AJAX requests

I have a question regarding an issue I ran into, which is connected to these two tickets, which got rejected:

http://bugs.jquery.com/ticket/12675

How is it possible to distinguish a failed Ajax request, which failed because the user navigated to another page, from Ajax requests that failed because of errors, not directly triggered by a user action. 
Currently I see no way to do so.

To reproduce:

1. Navigate browser (tried Chrome 46, Firefox 42) to http://jquery.com
2. Execute the following commands in the JavaScript Console
3. Define fail() callback function

  1. var onAjaxFailed = function( jqXHR, textStatus, errorThrown){console.log("AJAX failed!", jqXHR, textStatus, errorThrown)}

4. AJAX Request fails because of DNS error
  1. jQuery.ajax({url: "http://somedomainnamewhichreallyreallydoesnotexist.whatever"}).fail(onAjaxFailed)

Result:
GET http://somedomainnamewhichreallyreallydoesnotexist.whatever/ net::ERR_NAME_NOT_RESOLVEDsend @ jquery.min.js:4m.extend.ajax @ jquery.min.js:4(anonymous function) @ VM1446:2InjectedScript._evaluateOn @ VM1145:875InjectedScript._evaluateAndWrap @ VM1145:808InjectedScript.evaluate @ VM1145:664
AJAX failed! Object {readyState: 0, responseText: "", status: 0, statusText: "error"} error 

5. AJAX Request fails because of Same-origin policy
  1. jQuery.ajax({url: "http://stackoverflow.com"}).fail(onAjaxFailed)

Result:
XMLHttpRequest cannot load http://stackoverflow.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://qunitjs.com' is therefore not allowed access.
AJAX failed! Object {readyState: 0, responseText: "", status: 0, statusText: "error"} error 

6. AJAX Request fails because user navigates to another page
  1. jQuery.ajax({url: "/"}).fail(onAjaxFailed); document.location = "http://qunitjs.com/"

Result:
AJAX failed! Object {readyState: 0, responseText: "", status: 0, statusText: "error"} error 

So the arguments to the fail()-callback are always the same on these errors, even though they are very different in nature from my perspective.