Skip to content

Commit

Permalink
Use Sentry plug only when configured
Browse files Browse the repository at this point in the history
  • Loading branch information
loicknuchel committed Oct 10, 2024
1 parent 6a6707d commit 37f3c76
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/lib/azimutt_web/endpoint.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule AzimuttWeb.Endpoint do
use Sentry.PlugCapture
if System.get_env("SENTRY") == "true", do: use(Sentry.PlugCapture)
use Phoenix.Endpoint, otp_app: :azimutt

# The session will be stored in the cookie and signed,
Expand Down Expand Up @@ -59,11 +59,9 @@ defmodule AzimuttWeb.Endpoint do
pass: ["*/*"],
json_decoder: Phoenix.json_library()

plug Sentry.PlugContext

if System.get_env("SENTRY") == "true", do: plug(Sentry.PlugContext)
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug AzimuttWeb.Router
use Sentry.PlugCapture
end

0 comments on commit 37f3c76

Please sign in to comment.