Fixed DOI regex & added nicer fail message for crossref when DOI does not exist.

This commit is contained in:
Matt Burton 2009-04-29 18:08:34 +00:00
parent 8b5fbe7e96
commit b5974570e8
2 changed files with 6 additions and 2 deletions

View file

@ -37,6 +37,11 @@ function processCrossRef(xmlOutput) {
// ensure status is valid
if(!xml.doi_record.length()) return false;
// ensure this isn't an error
if(xml.doi_record.crossref.error.length()) {
throw xml.doi_record.crossref.error
return false;
}
if(xml.doi_record[0].crossref.journal.length()) {
var item = new Zotero.Item("journalArticle");
var itemXML = xml.doi_record.crossref.journal;