Trim exception stack trace in faults
This commit is contained in:
1 parent
12aa43c379
commit
c940bba4a3
2 files changed
+6
-3
No files matched your search
+4
-1
@@ -224,13 +224,16 @@ function errorToFault(err) {
|
||||
if (!err)
|
||||
return null;
|
||||
|
||||
// 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;
|
||||
|
||||
return {
|
||||
code: `script.${err.name}`,
|
||||
message: err.message,
|
||||
detail: {
|
||||
name: err.name,
|
||||
message: err.message,
|
||||
stack: err.stack
|
||||
stack: err.stack.slice(0, stackTrimIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user