Skip to content

Commit ba2400d

Browse files
committed
Only set stacktrace if frames are returned
1 parent e060c3c commit ba2400d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/node/src/eventbuilder.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ export function eventFromMessage(
9797
};
9898

9999
if (options.attachStacktrace && hint && hint.syntheticException) {
100-
event.stacktrace = {
101-
frames: hint.syntheticException ? extractStackFromError(hint.syntheticException) : [],
102-
};
100+
const frames = extractStackFromError(hint.syntheticException);
101+
if (frames.length) {
102+
event.stacktrace = { frames };
103+
}
103104
}
104105

105106
return event;

0 commit comments

Comments
 (0)