don't show errors about redirection status codes. Use the right channel.

bug 247490, r=mostafah
This commit is contained in:
mvl%exedo.nl 2004-06-19 10:19:16 +00:00
Родитель f87933eeda
Коммит a77fc7574c
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -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 )
{