Log errors thrown by calls to Zotero.Attachments

This commit is contained in:
Simon Kornblith 2012-11-22 16:38:03 -05:00
parent 11d9c1df04
commit 673962e999

View file

@ -233,6 +233,7 @@ Zotero.Translate.ItemSaver.prototype = {
(attachment.title ? attachment.title : undefined));
} catch(e) {
Zotero.debug("Translate: Error adding attachment "+attachment.url, 2);
Zotero.logError(e);
return;
}
Zotero.debug("Translate: Created attachment; id is "+myID, 4);
@ -345,6 +346,7 @@ Zotero.Translate.ItemSaver.prototype = {
(attachment.title ? attachment.title : undefined));
} catch(e) {
Zotero.debug("Translate: Error adding attachment "+attachment.url, 2);
Zotero.logError(e);
}
}
} else {
@ -354,6 +356,7 @@ Zotero.Translate.ItemSaver.prototype = {
Zotero.Attachments.importFromDocument(attachment.document, parentID, attachment.title);
} catch(e) {
Zotero.debug("Translate: Error attaching document", 2);
Zotero.logError(e);
}
// Save attachment if snapshot pref enabled or not HTML
// (in which case downloadAssociatedFiles applies)
@ -368,6 +371,7 @@ Zotero.Translate.ItemSaver.prototype = {
fileBaseName, null, mimeType, this._libraryID, null, this._cookieSandbox);
} catch(e) {
Zotero.debug("Translate: Error adding attachment "+attachment.url, 2);
Zotero.logError(e);
}
}
}