Skip to content

Rollbar browser trace chains duplicate the first stack to all trace chain items #1146

Open
@mathewbyrne

Description

@mathewbyrne

Recently I noticed our Typescript Vue app giving me Rollbar items with stacked errors featuring the same error trace:

image

Reaching out to support they informed me this is due to trace_chain being set in the payload, and is indicative that there are two errors, the first being the caught error and the second coming from error.cause.

This makes sense, our error classes do keep track of wrapped errors using cause, however I would expect to see two different stack traces, and in the examples I looked at, the trace was always duplicated.

Digging through the client, I can see support for this was added in #759 and #1012. But I believe there is an issue with this line:

var stack = stackFromItem(item);

For errors with causes, buildTrace is called in a loop, but each iteration continues to use the main stack trace from item. It's likely the line should be:

var stack = stackInfo.stack;

Since stackInfo is set to the current iteration.

More than happy to contribute a PR for this fix.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions