Skip to content

Wrapper Exceptions accumulate modifications. #373

@franchyd

Description

@franchyd

In Raygun4net4 when a wrapper exception is split up into its respective exceptions, it passes the same collection instances to each of the new messages:
https://github.com/MindscapeHQ/raygun4net/blob/master/Mindscape.Raygun4Net4/RaygunClient.cs#L440

The documentation for modifying messages suggests that we are able to modify these messages during the SendMessage event:
https://raygun.com/docs/languages/net/raygun.com#modify-cancel-message

But if we have a modifier, such as a tag that we append, the tags list gets modified for each and every exception in the AggregateException, but accumulating because they all share the same instance.

To summarize, the RaygunMessageBuilder needs to make copies of the lists/collections added to it otherwise AggregateExceptions and other exceptions that wrap multiple exceptions will accumulate modifications unnecessarily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions