mirror of
https://github.com/bonfire-networks/bonfire-app.git
synced 2024-05-04 02:08:44 +00:00
24 lines
442 B
Elixir
24 lines
442 B
Elixir
defmodule Bonfire.ErrorReporting do
|
|
@behaviour Plug
|
|
import Untangle
|
|
|
|
defmacro __using__(_) do
|
|
quote do
|
|
require Bonfire.Common.Extend
|
|
Bonfire.Common.Extend.use_if_enabled(Sentry.PlugCapture)
|
|
end
|
|
end
|
|
|
|
@impl true
|
|
def init(_opts) do
|
|
[]
|
|
end
|
|
|
|
@impl true
|
|
def call(conn, opts) do
|
|
if Bonfire.Common.Extend.module_enabled?(Sentry),
|
|
do: Sentry.PlugContext.call(conn, opts),
|
|
else: conn
|
|
end
|
|
end
|