Log errors on fact processors

This commit is contained in:
Álvaro 2024-06-15 21:24:08 +02:00
parent 0c0c7f1230
commit d24dc4726b
3 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,7 @@ defmodule LolAnalytics.Facts.ChampionPickedItem.FactProcessor do
{:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do {:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do
process_game_data(decoded_match) process_game_data(decoded_match)
else else
Logger.error("Could not process data from #{url} for ChampionPickedItem")
_ -> {:error, "Could not process data from #{url}"} _ -> {:error, "Could not process data from #{url}"}
end end
end end

View File

@ -13,7 +13,9 @@ defmodule LolAnalytics.Facts.ChampionPickedSummonerSpell.FactProcessor do
{:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do {:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do
process_game_data(decoded_match) process_game_data(decoded_match)
else else
_ -> {:error, "Could not process data from #{url}"} _ ->
Logger.error("Could not process data from #{url} for ChampionPickedSummonerSpell")
{:error, "Could not process data from #{url}"}
end end
end end

View File

@ -11,7 +11,9 @@ defmodule LolAnalytics.Facts.ChampionPlayedGame.FactProcessor do
{:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do {:ok, decoded_match} <- Poison.decode(body, as: %LoLAPI.Model.MatchResponse{}) do
process_game_data(decoded_match) process_game_data(decoded_match)
else else
_ -> {:error, "Could not process data from #{url}"} _ ->
Logger.error("Could not process data from #{url} for ChampionPlayedGame")
{:error, "Could not process data from #{url}"}
end end
end end