89389 - save as link should alert user if page doesn't exist (and not save the link). r=bz sr=hewitt

This commit is contained in:
blakeross%telocity.com 2006-07-29 05:39:45 +00:00
parent 3313633865
commit b443628061
2 changed files with 12 additions and 7 deletions

View File

@ -187,7 +187,8 @@ function saveInternal(aURL, aDocument,
fileName: aFileName,
filePickerTitle: aFilePickerTitleKey,
document: aDocument,
bypassCache: aShouldBypassCache
bypassCache: aShouldBypassCache,
window: window
};
var sniffer = new nsHeaderSniffer(aURL, foundHeaderInfo, data);
}
@ -300,12 +301,14 @@ nsHeaderSniffer.prototype = {
}
catch (e) {
}
} else {
// Failed the link check. This could be due to an issue with
// the link checker, though. Throw an exception and let the
// catch() deal with it as it would with any other link check
// failure.
throw("Link check failed");
}
else {
var bundle = getStringBundle();
var errorTitle = bundle.GetStringFromName("saveLinkErrorTitle");
var errorMsg = bundle.GetStringFromName("saveLinkErrorMsg");
const promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
promptService.alert(this.mData.window, errorTitle, errorMsg);
return;
}
}
catch (e) {

View File

@ -12,3 +12,5 @@ WebPageHTMLOnlyFilter=Web Page, HTML only
TextOnlyFilter=Text File
AllFilesFilter=All Files
saveLinkErrorMsg=The link could not be saved. The web page might have been removed or had its name changed.
saveLinkErrorTitle=Save Link