diff --git a/lib/error_tracker/integrations/phoenix.ex b/lib/error_tracker/integrations/phoenix.ex index 1a51b4f..47b3a84 100644 --- a/lib/error_tracker/integrations/phoenix.ex +++ b/lib/error_tracker/integrations/phoenix.ex @@ -60,7 +60,9 @@ defmodule ErrorTracker.Integrations.Phoenix do [:phoenix, :live_view, :handle_params, :exception], [:phoenix, :live_view, :handle_event, :start], [:phoenix, :live_view, :handle_event, :exception], - [:phoenix, :live_view, :render, :exception] + [:phoenix, :live_view, :render, :exception], + [:phoenix, :live_component, :update, :exception], + [:phoenix, :live_component, :handle_event, :exception] ] @doc false @@ -111,4 +113,23 @@ defmodule ErrorTracker.Integrations.Phoenix do def handle_event([:phoenix, :live_view, _action, :exception], _, metadata, :no_config) do ErrorTracker.report({metadata.kind, metadata.reason}, metadata.stacktrace) end + + def handle_event([:phoenix, :live_component, :update, :exception], _, metadata, :no_config) do + ErrorTracker.report({metadata.kind, metadata.reason}, metadata.stacktrace, %{ + "live_view.component" => metadata.component + }) + end + + def handle_event( + [:phoenix, :live_component, :handle_event, :exception], + _, + metadata, + :no_config + ) do + ErrorTracker.report({metadata.kind, metadata.reason}, metadata.stacktrace, %{ + "live_view.component" => metadata.component, + "live_view.event" => metadata.event, + "live_view.event_params" => metadata.params + }) + end end