Skip to content

Support for context in nested exceptions (causes) #6

@subzero10

Description

@subzero10

Context

We recently had an issue reported in which a user tried to use the cause property with a non-error type object. This should be expected behavior in javascript.

In order to support a dynamic data structure, a slack discussion brought us to the following proposal:

  • Add a new context (name to decided) property in the causes.items.properties schema.
  • The properties class, message, backtrace will have to become optional.
  • In the case of the javascript issue above, we would put the JSON result of the non-error type cause object as the data for the context property. The other properties (class, message, backtrace) will not have any value.
  • For Ruby, we already have support for a context on the main error/exception. This context is merged with the global context. For each error/exception in the nested causes, we could add their context in this new property.

Obviously, this implies that work will have to be done on the backend (?) and Honeybadger UI to support this new property and the dynamic data structure of a cause object. For example, the following block only works when the cause item has the properties class, message, backtrace. We will have to modify to support cases where these properties are not set or when the context property has a value, which will be a dynamic JSON structure.

image

Let me know what you think!
cc @joshuap

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions