Fix error trying to trim a partial stack trace
This commit is contained in:
1 parent
fb229897f7
commit
bc8619e199
1 file changed
+4
-2
+4
-2
@@ -285,9 +285,11 @@ function errorToFault(err) {
|
||||
};
|
||||
|
||||
if (err.stack) {
|
||||
fault.detail.stack = err.stack;
|
||||
// Trim the stack trace at the self-executing anonymous wrapper function
|
||||
let stackTrimIndex = err.stack.match(/\s+at\s[^\s]+\s+at\s[^\s]+\s\(vm\.js.+\)/).index;
|
||||
fault.detail.stack = err.stack.slice(0, stackTrimIndex);
|
||||
let stackTrimIndex = fault.detail.stack.match(/\s+at\s[^\s]+\s+at\s[^\s]+\s\(vm\.js.+\)/);
|
||||
if (stackTrimIndex)
|
||||
fault.detail.stack = fault.detail.stack.slice(0, stackTrimIndex.index);
|
||||
}
|
||||
|
||||
return fault;
|
||||
|
||||
Reference in new issue
Block a user