Refactor code to use Path class

This commit is contained in:
Zaid Abdulla committed 2019-02-26 01:38:23 -08:00
1 parent 006f83a478
commit f878d828eb
13 files changed
+663 -784

No files matched your search

+8 -4
View File
@@ -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;