mirror of
https://github.com/zotero/zotero.git
synced 2026-10-10 03:28:10 +00:00
Dump stack on translation failure in newer versions of Firefox, where it appears to have ceased to be enumerable
This commit is contained in:
parent
e8ac371042
commit
6bed648eb2
1 changed files with 6 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue