include error message in stack trace for Safari/Firefox
This commit is contained in:
parent
49695ff50c
commit
617c1c9ee9
|
@ -552,8 +552,15 @@ function onError(message, error) {
|
||||||
if (config.debug) { console.error(error.stack); }
|
if (config.debug) { console.error(error.stack); }
|
||||||
// rethrow new high level error for api users
|
// rethrow new high level error for api users
|
||||||
const newError = new Error(message + ': ' + error.message);
|
const newError = new Error(message + ': ' + error.message);
|
||||||
|
|
||||||
|
// Standardize stack trace for tests
|
||||||
|
if (error.stack.indexOf(error.message) === -1) {
|
||||||
|
error.stack = 'Error: ' + error.message + '\n' + error.stack;
|
||||||
|
}
|
||||||
|
|
||||||
//newError.innerError = error;
|
//newError.innerError = error;
|
||||||
newError.stack += '\n' + error.stack;
|
newError.stack += '\n' + error.stack;
|
||||||
|
|
||||||
throw newError;
|
throw newError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user