diff --git a/.tool-versions b/.tool-versions index 3a771604..f1edb14d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -elixir 1.10.2 +elixir 1.10.3-otp-23 diff --git a/lib/pigeon/fcm/config.ex b/lib/pigeon/fcm/config.ex index dcc94432..162377dc 100644 --- a/lib/pigeon/fcm/config.ex +++ b/lib/pigeon/fcm/config.ex @@ -180,8 +180,12 @@ defimpl Pigeon.Configurable, for: Pigeon.FCM.Config do def parse_error(data) do case Pigeon.json_library().decode(data) do + {:ok, %{"reason" => reason}} -> + reason |> Macro.underscore() |> String.to_existing_atom() + {:ok, response} -> - response["reason"] |> Macro.underscore() |> String.to_existing_atom() + Logger.warn("error with no reason #{response["error"]}") + :unspecified_reason error -> "JSON parse failed: #{inspect(error)}, body: #{inspect(data)}" diff --git a/mix.exs b/mix.exs index 7032597b..54e81ffc 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Pigeon.Mixfile do use Mix.Project - @version "1.6.1" + @version "1.7.1" def project do [