Show errors from publishing.
bug 271029, r=mostafah git-svn-id: svn://10.0.0.236/trunk@166212 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
8992981dce
commit
6ed6421a7f
@ -285,6 +285,25 @@ var gPublishingListener =
|
||||
onStopRequest: function(request, ctxt, status, errorMsg)
|
||||
{
|
||||
dump("onStopRequest status = " + request.status.toString(16) + " " + errorMsg + "\n");
|
||||
var ch;
|
||||
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
try {
|
||||
ch = request.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
dump(ch.requestSucceeded+"\n");
|
||||
} catch(e) {
|
||||
}
|
||||
if (ch && !ch.requestSucceeded) {
|
||||
promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),
|
||||
calendarStringBundle.formatStringFromName('httpPutError',[ch.responseStatus, ch.responseStatusText],2));
|
||||
}
|
||||
|
||||
else if (ch && !Components.isSuccessCode(request.status)) {
|
||||
// XXX this should be made human-readable.
|
||||
promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),
|
||||
calendarStringBundle.formatStringFromName('otherPutError',[request.status.toString(16)],1));
|
||||
}
|
||||
},
|
||||
|
||||
onDataAvailable: function(request, ctxt, inStream, sourceOffset, count)
|
||||
|
||||
@ -200,4 +200,6 @@ outlookCSVDateParseConfirm=\
|
||||
errorTitle=Error getting calendar
|
||||
httpError=Getting the calendar file failed.\nStatus code: %1$S: %2$S
|
||||
otherError=Getting the calendar file failed.\nStatus code: 0x%1$S
|
||||
httpPutError=Publishing the calendar file failed.\nStatus code: %1$S: %2$S
|
||||
otherPutError=Publishing the calendar file failed.\nStatus code: 0x%1$S
|
||||
contentError=This doesn't appear to be a valid file. Here's what I got back from\n%1$S:\nResult: %2$S
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user