Skip to content

Commit

Permalink
Merge pull request #98 from withmask/master
Browse files Browse the repository at this point in the history
Potential fix for #96
  • Loading branch information
terehov committed Apr 14, 2021
2 parents 01c9e8c + aae149b commit 0620eee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"devDependencies": {
"@microsoft/api-extractor": "^7.13.2",
"@rushstack/eslint-config": "^2.3.2",
"@typescript-eslint/types": "^4.21.0",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.33",
"@types/source-map-support": "^0.5.3",
Expand Down
17 changes: 9 additions & 8 deletions src/LoggerWithoutCallSite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,15 @@ export class LoggerWithoutCallSite {
relevantCallSites.length = stackLimit;
}

const errorObject: IErrorObject = (LoggerHelper.cloneObjectRecursively(
error
) as unknown) as IErrorObject;
errorObject.nativeError = error;
errorObject.details = { ...error };
errorObject.name = errorObject.name ?? "Error";
errorObject.isError = true;
errorObject.stack = this._toStackObjectArray(relevantCallSites);
const errorObject: IErrorObject = {
nativeError: error,
details: { ...error },
name: error.name ?? "Error",
isError: true,
message: error.message,
stack: this._toStackObjectArray(relevantCallSites),
};

if (errorObject.stack.length > 0) {
const errorCallSite: IStackFrame = LoggerHelper.toStackFrameObject(
this._callSiteWrapper(relevantCallSites[0])
Expand Down

0 comments on commit 0620eee

Please sign in to comment.