commit 369151be00f2770be972abb825888111a3231363
parent ae607592f6b42fb66f1d54ead250c9dc98ab09b5
Author: Simon Kornblith <simon@simonster.com>
Date: Thu, 9 Jun 2011 02:00:33 +0000
- fix typo
- log a message and don't fail due to invalid metadata for a single item
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/translators/unAPI.js b/translators/unAPI.js
@@ -9,7 +9,7 @@
"priority":200,
"inRepository":true,
"detectXPath":"//link[@rel='unapi-server']",
- "lastUpdated":"2011-04-19 19:40:07"
+ "lastUpdated":"2011-06-09 01:57:14"
}
var RECOGNIZABLE_FORMATS = ["rdf_zotero", "rdf_bibliontology", "mods", "marc", "unimarc", "ris",
@@ -152,7 +152,12 @@ UnAPIID.prototype = {
// run callback on item array
callback(me.items);
});
- translator.translate();
+ try {
+ translator.translate();
+ } catch(e) {
+ Zotero.debug("unAPI: Could not parse "+me.format.name+" metadata for ID "+me.id+": "+e);
+ callback(me.items);
+ }
});
});
},
@@ -177,7 +182,7 @@ UnAPIID.prototype = {
} else {
// if no supported default format, try format for this item
Zotero.Utilities.HTTP.doGet(unAPIResolver+"?id="+me.id, function(text) {
- me.format = UnAPIFormat(text);
+ me.format = new UnAPIFormat(text);
callback(!!me.format.isSupported);
});
}