Hi Dev's,
Rarely an error is showed in browser with message "Server Error! (OK)". It's generated
by jQuery error handler [1], but the "OK" is the 200 request status code. So, someone
know why this error is generated?
I don't know how to reproduce this error because it's too rarely here.
We can avoid this error using a check like " if (errmsg && request.status != '200') "
but I think that the jQuery error handler should not return a 200 status anyway.
The jQuery documentation says: "Note: Do not set handlers for complete, error, or
success functions with this method (jQuery.ajaxSetup); use the global ajax events
instead."
Should we move the error handler to ajax events? Maybe it's related to the error handler
returning a 200 status code.
There are some other issues related to error handler returning a 200 code too:
http://www.roundcubeforum.net/issues-bugs/5115-server-error-ok.html
http://trac.roundcube.net/ticket/1486159
Opinions?
[1]
jQuery.ajaxSetup({ cache:false,
error:function(request, status, err){ ref.http_error(request, status, err); },
beforeSend:function(xmlhttp){ xmlhttp.setRequestHeader('X-RoundCube-Request', ref.env.request_token); }
});
...
var errmsg = request.statusText;
...
this.display_message('Unknown Server Error!' + (errmsg ? ' ('+errmsg+')' : ''), 'error');
if (errmsg)
this.display_message(this.get_label('servererror') + ' (' + errmsg + ')', 'error');
};
--
Victor Benincasa