Skip to content

Commit

Permalink
CLEAN
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Jul 31, 2023
1 parent 8c3db60 commit 1313e10
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,11 @@ export default class SenseLogs {
} else if (context.err instanceof Error) {
// Extract error and cleanup context
exception = {code: context.err.code, message: context.err.message, stack: context.err.stack}
delete ctx.err.code
delete ctx.err.message
delete ctx.err.stack
if (Object.keys(context).length == 1) {
// {err} is only context, so hoist
ctx = context.err
} else {
delete ctx.err
}
}
if (exception) {
Expand Down

0 comments on commit 1313e10

Please sign in to comment.