diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index aab6c51d8..cd515a74e 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -49,6 +49,7 @@ var Zotero = new function(){ this.backupDatabase = backupDatabase; this.debug = debug; this.varDump = varDump; + this.safeDebug = safeDebug; this.getString = getString; this.flattenArguments = flattenArguments; this.getAncestorByTagName = getAncestorByTagName; @@ -325,6 +326,21 @@ var Zotero = new function(){ } + function safeDebug(obj){ + for (var i in obj){ + try { + Zotero.debug(i + ': ' + obj[i]); + } + catch (e){ + try { + Zotero.debug(i + ': ERROR'); + } + catch (e){} + } + } + } + + function getString(name, params){ try { if (params){