[js][internals] updated nativeToJSError util to exclude itself from error stacks
This commit is contained in:
parent
6a8656f428
commit
92504580e5
|
@ -305,6 +305,9 @@ export function nativeToJSError(code: string, message: string, additionalProps?:
|
|||
const error = new Error(message);
|
||||
error.code = code;
|
||||
Object.assign(error, additionalProps);
|
||||
// exclude this function from the stack
|
||||
const _stackArray = error.stack.split('\n');
|
||||
error.stack = _stackArray.splice(1, _stackArray.length).join('\n');
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue