diff --git a/lib/plausible/google/ua/http.ex b/lib/plausible/google/ua/http.ex index 302c90a19..49cfad2aa 100644 --- a/lib/plausible/google/ua/http.ex +++ b/lib/plausible/google/ua/http.ex @@ -45,10 +45,18 @@ defmodule Plausible.Google.UA.HTTP do {:ok, {report, token}} else {:error, %{reason: %{status: status, body: body}}} -> + Logger.debug( + "[#{inspect(__MODULE__)}:#{report_request.view_id}] Request failed for #{report_request.dataset} with code #{status}: #{inspect(body)}" + ) + Sentry.Context.set_extra_context(%{ga_response: %{body: body, status: status}}) {:error, :request_failed} - {:error, _reason} -> + {:error, reason} -> + Logger.debug( + "[#{inspect(__MODULE__)}:#{report_request.view_id}] Request failed for #{report_request.dataset}: #{inspect(reason)}" + ) + {:error, :request_failed} end end diff --git a/lib/plausible_web/live/imports_exports_settings.ex b/lib/plausible_web/live/imports_exports_settings.ex index 548ea7edf..d29595bd1 100644 --- a/lib/plausible_web/live/imports_exports_settings.ex +++ b/lib/plausible_web/live/imports_exports_settings.ex @@ -135,8 +135,11 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do /> + + Import failed - + <%= Plausible.Imported.SiteImport.label(entry.site_import) %> (<%= PlausibleWeb.StatsView.large_number_format( @@ -147,9 +150,13 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do

From <%= format_date(entry.site_import.start_date) %> to <%= format_date( entry.site_import.end_date - ) %> (created on <%= format_date( - entry.site_import.inserted_at || entry.site_import.start_date - ) %>) + ) %> + <%= if entry.live_status == SiteImport.completed() do %> + (imported + <% else %> + (started + <% end %> + on <%= format_date(entry.site_import.inserted_at) %>)

<.button @@ -160,9 +167,12 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do class="sm:ml-3 sm:w-auto w-full" data-confirm="Are you sure you want to delete this import?" > - + Delete Import + + Discard + Cancel Import