From beed1936053e09a4e9ef93471af00e81967eb319 Mon Sep 17 00:00:00 2001 From: Graham McInitre Date: Thu, 16 Jul 2026 07:17:52 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20handle=20GIRO=20API=20404=20cleanly=20?= =?UTF-8?q?=E2=80=94=20don't=20dump=20raw=20HTML=20into=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/microwaveprop/ionosphere/giro_client.ex | 7 +++++-- lib/microwaveprop/workers/ionosphere_fetch_worker.ex | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/microwaveprop/ionosphere/giro_client.ex b/lib/microwaveprop/ionosphere/giro_client.ex index 138fbe56..44093b5d 100644 --- a/lib/microwaveprop/ionosphere/giro_client.ex +++ b/lib/microwaveprop/ionosphere/giro_client.ex @@ -58,8 +58,11 @@ defmodule Microwaveprop.Ionosphere.GiroClient do {:ok, %{status: 200, body: body}} when is_binary(body) -> parse_tabular(body) - {:ok, %{status: status, body: body}} -> - {:error, "GIRO HTTP #{status}: #{inspect(body)}"} + {:ok, %{status: 404}} -> + {:error, :giro_api_unavailable} + + {:ok, %{status: status}} -> + {:error, "GIRO HTTP #{status}"} {:error, reason} -> {:error, "GIRO request failed: #{inspect(reason)}"} diff --git a/lib/microwaveprop/workers/ionosphere_fetch_worker.ex b/lib/microwaveprop/workers/ionosphere_fetch_worker.ex index 0cb319ee..d94958f3 100644 --- a/lib/microwaveprop/workers/ionosphere_fetch_worker.ex +++ b/lib/microwaveprop/workers/ionosphere_fetch_worker.ex @@ -74,5 +74,6 @@ defmodule Microwaveprop.Workers.IonosphereFetchWorker do end defp format_reason(reason) when is_binary(reason), do: reason + defp format_reason(:giro_api_unavailable), do: "GIRO API endpoint unavailable (404)" defp format_reason(reason), do: inspect(reason, printable_limit: 200) end