mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 00:14:48 +00:00
cb4a801519
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
17 lines
553 B
Elixir
17 lines
553 B
Elixir
defmodule Mobilizon.Service.ErrorReporter do
|
|
@moduledoc """
|
|
Module to delegate all exceptions to Sentry
|
|
"""
|
|
def handle_event([:oban, :job, :exception], measure, %{job: job} = meta, _) do
|
|
extra =
|
|
job
|
|
|> Map.take([:id, :args, :meta, :queue, :worker])
|
|
|> Map.merge(measure)
|
|
|
|
Sentry.capture_exception(meta.error, stacktrace: meta.stacktrace, extra: extra)
|
|
end
|
|
|
|
def handle_event([:oban, :circuit, :trip], _measure, meta, _) do
|
|
Sentry.capture_exception(meta.error, stacktrace: meta.stacktrace, extra: meta)
|
|
end
|
|
end
|