Fix debug output of thrown errors
At some point this switched to showing just the line on which the error occurred.
This commit is contained in:
parent
662be5e198
commit
da09a8dfcd
1 changed files with 17 additions and 1 deletions
|
@ -46,7 +46,23 @@ Zotero.Debug = new function () {
|
|||
return;
|
||||
}
|
||||
|
||||
if (typeof message != 'string') {
|
||||
// Properly display thrown Error objects
|
||||
if (message && message.constructor) {
|
||||
switch (message.constructor.name) {
|
||||
case 'Error':
|
||||
case 'EvalError':
|
||||
case 'RangeError':
|
||||
case 'ReferenceError':
|
||||
case 'SyntaxError':
|
||||
case 'TypeError':
|
||||
case 'URIError':
|
||||
message = "'message' => \"" + message.message + "\"\n"
|
||||
+ Zotero.Utilities.varDump(message) + "\n"
|
||||
+ message.stack;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (typeof message != 'string') {
|
||||
message = Zotero.Utilities.varDump(message);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue