Fix an NS_ERROR_FAILURE from nsIFileURL.file, though I don't yet know what causes it

This commit is contained in:
Dan Stillman 2010-09-07 08:57:35 +00:00
parent 6a42d2ee12
commit 1f93fa405c

View file

@ -1530,16 +1530,24 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) {
var uri = IOService.newURI(item.path, "", null); var uri = IOService.newURI(item.path, "", null);
} }
catch (e) { catch (e) {
Components.utils.reportError("Error parsing attachment path: " + item.path); var msg = "Error parsing attachment path: " + item.path;
Zotero.debug("Translate: Error parsing attachment path '" + item.path + "'", 2); Components.utils.reportError(msg);
Zotero.debug("Translate: " + msg, 2);
} }
if (uri) { if (uri) {
try {
var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file; var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
if (file.path == '/') { if (file.path == '/') {
Components.utils.reportError("Error parsing attachment path: " + item.path); var msg = "Error parsing attachment path: " + item.path;
Zotero.debug("Translate: Error parsing attachment attachment '" + item.path + "'", 2); Components.utils.reportError(msg);
Zotero.debug("Translate: " + msg, 2);
}
}
catch (e) {
var msg = "Error getting file from attachment path: " + item.path;
Components.utils.reportError(msg);
Zotero.debug("Translate: " + msg, 2);
} }
} }