Refactor code to use Path class
This commit is contained in:
1 parent
006f83a478
commit
f878d828eb
13 files changed
+663
-784
No files matched your search
+8
-4
@@ -40,13 +40,17 @@ function errorToFault(err: Error): Fault {
|
||||
};
|
||||
|
||||
if (err.stack) {
|
||||
fault.detail.stack = err.stack;
|
||||
fault.detail["stack"] = err.stack;
|
||||
// Trim the stack trace
|
||||
const stackTrimIndex = fault.detail.stack.match(
|
||||
const stackTrimIndex = fault.detail["stack"].match(
|
||||
/\s+at\s[^\s]+\s\(.*genieacs-ext:.+\)/
|
||||
);
|
||||
if (stackTrimIndex)
|
||||
fault.detail.stack = fault.detail.stack.slice(0, stackTrimIndex.index);
|
||||
if (stackTrimIndex) {
|
||||
fault.detail["stack"] = fault.detail["stack"].slice(
|
||||
0,
|
||||
stackTrimIndex.index
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return fault;
|
||||
|
||||
Reference in new issue
Block a user