diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 9a4e0357f2..bb29810368 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1406,7 +1406,6 @@ Zotero.Translate.Base.prototype = { Zotero.debug(string, level); } }, - /** * Generates a string from an exception * @param {String|Exception} error @@ -1416,13 +1415,17 @@ Zotero.Translate.Base.prototype = { if(typeof(error) == "string") { errorString = "\nthrown exception => "+error; } else { + var haveStack = false; for(var i in error) { if(typeof(error[i]) != "object") { + if(i === "stack") haveStack = true; errorString += "\n"+i+' => '+error[i]; } } - if(error) { - errorString += "\nstring => "+error.toString(); + errorString += "\nstring => "+error.toString(); + if(!haveStack && error.stack) { + // In case the stack is not enumerable + errorString += "\nstack => "+error.stack.toString(); } }