Open shinnokdisengir opened 5 months ago
The library jason was adopted after poison but the errors were not updated
jason
poison
{:error, %Jason.DecodeError{} }
{:error, {:invalid, _invalid_str, _invalid_pos}} -> _ = Logger.warning("Received invalid interface JSON: #{inspect(interface_json)}.", tag: "invalid_json" ) {:error, :invalid_interface_document} {:error, %Ecto.Changeset{} = changeset} -> _ = Logger.warning("Received invalid interface: #{inspect(changeset)}.", tag: "invalid_interface_document" ) {:error, :invalid_interface_document}
see here: https://github.com/astarte-platform/astarte/blob/c335319e11dc0c0d8b0b28e8a36b26af33f5fc60/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex#L97 https://github.com/astarte-platform/astarte/blob/c335319e11dc0c0d8b0b28e8a36b26af33f5fc60/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex#L176
The fix of the issue could be also just removing the error handling since the json is already validated by api so it shouldn't fail
Description
The library
jason
was adopted afterpoison
but the errors were not updatedExpected Behavior
Current Behavior
see here: https://github.com/astarte-platform/astarte/blob/c335319e11dc0c0d8b0b28e8a36b26af33f5fc60/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex#L97 https://github.com/astarte-platform/astarte/blob/c335319e11dc0c0d8b0b28e8a36b26af33f5fc60/apps/astarte_realm_management/lib/astarte_realm_management/engine.ex#L176
Additional Information
The fix of the issue could be also just removing the error handling since the json is already validated by api so it shouldn't fail