In Dartium, and at least in Chrome JS, you can detect a failure by seeing that you press ReadyState == 4 ("done") with a status of zero. Zero is not a valid server response, all HTTP server responses exceed 100, so this means that it did not actually reach the server (or at least the server did not say proper HTTP).
onError .
.