-
Notifications
You must be signed in to change notification settings - Fork 17
Description
why cannot catch ajax error, net error ?
this my code
window.onerror = function( message, url, line, column, error ) {
// var e = encodeURIComponent;
// ( new Image() ).src = 'http://127.0.0.1:3000/error?message=' + e( message ) +
// '&url=' + e( url ) +
// '&line=' + e( line ) +
// ( error && error.stack ? '&stack=' + e( error.stack ) : '' ) +
// ( column ? '&column=' + e( column ) : '' );
console.warn(message, url, line, column, error);
}
$.getJSON( '',
{f: 'json', 'asdebug-tag': ''},
function(json){
setContent(json);
setTimeout('refresh()',500);
} );
if the url cannot load, the brower return 404 net error , but this error cannot catch