зеркало из https://github.com/mozilla/gecko-dev.git
don't show errors about redirection status codes. Use the right channel.
bug 247490, r=mostafah
This commit is contained in:
Родитель
f87933eeda
Коммит
a77fc7574c
|
@ -670,11 +670,20 @@ calendarManager.prototype.getRemoteCalendarText = function calMan_getRemoteCalen
|
|||
if( typeof( result ) != "string" ) //for 1.7 compatibility
|
||||
result = String.fromCharCode.apply(this, result);
|
||||
|
||||
var ch = Channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
if (!ch.requestSucceeded) {
|
||||
var ch;
|
||||
try {
|
||||
ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
} catch(e) {
|
||||
}
|
||||
if (ch && !ch.requestSucceeded) {
|
||||
alert("Getting the calendar file failed.\nStatus code: "+ch.responseStatus+": "+ch.responseStatusText);
|
||||
}
|
||||
|
||||
else if (!Components.isSuccessCode(loader.request.status)) {
|
||||
// XXX this should be made human-readable.
|
||||
alert("Getting the calendar file failed.\nStatus code: 0x"+loader.request.status.toString(16));
|
||||
}
|
||||
|
||||
//check to make sure its actually a calendar file, if not return.
|
||||
else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 )
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче