Skip to content

Documentation for Custom grouping logic has incorrect definition of the callback parameter #96

@simonwaterer-c3

Description

@simonwaterer-c3

The documentation for Custom grouping logic states that:

The callback's one parameter is an instance of RaygunMessage (python[2/3]/raygunmsgs.py), and the callback should return a string.

But it appears that this is not the case. Instead it appears to be a dict object which is returned from RaygunSender._transform_message as a result of calling utilities.filter_keys.

The code at utilities.py Line 16 has this:

if isinstance(object, raygunmsgs.RaygunMessage):
        iteration_target = object.__dict__

which is the point where the RaygunMessage is converted to a dict.

The sample code return raygun_message.get_error().message[:100] therefore crashes with an AttributeError:

AttributeError: 'dict' object has no attribute 'get_error'

This however will work:

return raygun_message['details']['error'].message[:100]

The raygun_message['details']['error'] accesses the instance of RaygunErrorMessage

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions