Improve error reporting and add test

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-08-03 12:15:54 +02:00
parent ec745b3e80
commit cceb083ad7
4 changed files with 107 additions and 8 deletions

View File

@@ -68,14 +68,11 @@ defmodule Mobilizon do
ErrorReporting.configure()
:ok = Oban.Telemetry.attach_default_logger()
:telemetry.attach_many(
"oban-errors",
[[:oban, :job, :exception], [:oban, :circuit, :trip]],
&ErrorReporting.handle_event/4,
%{}
)
# Only attach the telemetry logger when we aren't in an IEx shell
unless Code.ensure_loaded?(IEx) && IEx.started?() do
Oban.Telemetry.attach_default_logger(:info)
ErrorReporting.attach()
end
Supervisor.start_link(children, strategy: :one_for_one, name: Mobilizon.Supervisor)
end