Trim stack trace from extension errors

This commit is contained in:
Zaid Abdulla committed 2018-02-21 15:28:47 -08:00
1 parent 75ddfc38b1
commit 0d6f9265f7
1 file changed
+6 -1
+6 -1
View File
@@ -38,8 +38,13 @@ function errorToFault(err) {
}
};
if (err.stack)
if (err.stack) {
fault.detail.stack = err.stack;
// Trim the stack trace
let stackTrimIndex = fault.detail.stack.match(/\s+at\s[^\s]+\s\(.*extension-wrapper\.js:.+\)/);
if (stackTrimIndex)
fault.detail.stack = fault.detail.stack.slice(0, stackTrimIndex.index);
}
return fault;
}