BoopErrorTracker.Event (BoopErrorTracker v1.1.0)

Copy Markdown View Source

Translates an ErrorTracker error + occurrence into a Boop.Event.

Works on the %ErrorTracker.Error{} / %ErrorTracker.Occurrence{} structs but only reads fields, so plain maps with the same keys work too (that is how the tests drive it).

Summary

Functions

The action buttons for an error: "Open in ErrorTracker" when error_tracker_url is set, followed by whatever actions (a list, or a function of error and occurrence) returns. Boop shows at most three; anything beyond that is dropped, and a failing function only costs the extra buttons, never the event.

Builds the Boop event for trigger (:new, :unresolved, :occurrence).

Functions

actions(error, occurrence, config)

@spec actions(map(), map() | nil, BoopErrorTracker.Config.t()) :: [
  Boop.Event.action()
]

The action buttons for an error: "Open in ErrorTracker" when error_tracker_url is set, followed by whatever actions (a list, or a function of error and occurrence) returns. Boop shows at most three; anything beyond that is dropped, and a failing function only costs the extra buttons, never the event.

build(error, occurrence, trigger, config)

Builds the Boop event for trigger (:new, :unresolved, :occurrence).