Handle style errors in CSL Preview window
Keep going, and log the error
This commit is contained in:
parent
9de954afc7
commit
55e8f7914b
1 changed files with 12 additions and 4 deletions
|
@ -60,11 +60,19 @@ var Zotero_CSL_Preview = new function() {
|
||||||
if (style.source) {
|
if (style.source) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Zotero.debug("Generate Bib for " + style.title);
|
Zotero.debug("Generate bibliography for " + style.title);
|
||||||
var cite = generateBibliography(style);
|
let bib;
|
||||||
if (cite) {
|
let err = false;
|
||||||
|
try {
|
||||||
|
bib = generateBibliography(style);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
err = e;
|
||||||
|
Zotero.logError(e);
|
||||||
|
}
|
||||||
|
if (bib || err) {
|
||||||
str += '<h3>' + style.title + '</h3>';
|
str += '<h3>' + style.title + '</h3>';
|
||||||
str += cite;
|
str += bib || `<p style="color: red">${Zotero.Utilities.htmlSpecialChars(err)}</p>`;
|
||||||
str += '<hr>';
|
str += '<hr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue