Verification follow-up improvements (#5568)

* handle unhandled verification case

* log site domain on browserless errors

* mix format

* info -> warning to see the logs
This commit is contained in:
RobertJoonas 2025-07-15 09:59:11 +03:00 committed by GitHub
parent b76996b3a4
commit 39c006bfb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

@ -100,11 +100,17 @@ defmodule Plausible.Verification.Checks.Installation do
)
{:ok, %{status: status, body: %{"data" => %{"error" => error}}}} ->
Logger.warning("[VERIFICATION] Browserless JS error: #{inspect(error)}")
Logger.warning(
"[VERIFICATION] Browserless JS error (data_domain='#{data_domain}'): #{inspect(error)}"
)
put_diagnostics(state, plausible_installed?: false, service_error: status)
{:error, %{reason: reason}} ->
Logger.warning("[VERIFICATION] Browserless request error: #{inspect(reason)}")
Logger.warning(
"[VERIFICATION] Browserless request error (data_domain='#{data_domain}'): #{inspect(reason)}"
)
put_diagnostics(state, plausible_installed?: false, service_error: reason)
end
end
@ -148,7 +154,7 @@ defmodule Plausible.Verification.Checks.Installation do
}
|> Map.merge(diffs)
Logger.info("[VERIFICATION] js_elixir_diff: #{inspect(info)}")
Logger.warning("[VERIFICATION] js_elixir_diff: #{inspect(info)}")
end
:telemetry.execute(telemetry_event(any_diff?), %{})

View File

@ -211,11 +211,12 @@ defmodule Plausible.Verification.Diagnostics do
def interpret(
%__MODULE__{
plausible_installed?: true,
callback_status: 0,
callback_status: callback_status,
proxy_likely?: true
},
_url
) do
)
when callback_status in [0, 500] do
error(@errors.proxy_misconfigured)
end