diff --git a/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex b/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex index 5b0685bf5..06c9c7db0 100644 --- a/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex +++ b/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex @@ -95,9 +95,9 @@ defmodule Astarte.RealmManagement.Engine do Queries.install_new_interface(client, interface_doc, automaton) end else - {:error, {:invalid, _invalid_str, _invalid_pos}} -> + {:error, %Jason.DecodeError{} = jason_error_interface} -> _ = - Logger.warning("Received invalid interface JSON: #{inspect(interface_json)}.", + Logger.warning("Received invalid interface JSON: #{inspect(jason_error_interface)}.", tag: "invalid_json" ) @@ -177,9 +177,9 @@ defmodule Astarte.RealmManagement.Engine do ) end else - {:error, {:invalid, _invalid_str, _invalid_pos}} -> + {:error, %Jason.DecodeError{} = jason_error_interface} -> _ = - Logger.warning("Received invalid interface JSON: #{inspect(interface_json)}.", + Logger.warning("Received invalid interface JSON: #{inspect(jason_error_interface)}.", tag: "invalid_json" ) @@ -885,7 +885,7 @@ defmodule Astarte.RealmManagement.Engine do end defp decode_policy(policy_json) do - with {:error, {:invalid, _invalid_str, _invalid_pos}} <- Jason.decode(policy_json) do + with {:error, %Jason.DecodeError{}} <- Jason.decode(policy_json) do _ = Logger.warning("Received invalid trigger policy JSON: #{inspect(policy_json)}.", tag: "invalid_trigger_policy_json"