Fix a credo issue

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-20 10:06:58 +02:00
parent 2b3d1d7f79
commit b94bf2ad87
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -196,9 +196,10 @@ defmodule Mobilizon.GraphQL.Resolvers.Resource do
}
} = _resolution
) do
with {:ok, data} when is_map(data) <- Parser.parse(resource_url) do
{:ok, struct(Metadata, data)}
else
case Parser.parse(resource_url) do
{:ok, data} when is_map(data) ->
{:ok, struct(Metadata, data)}
{:error, _err} ->
Logger.warn("Error while fetching preview from #{inspect(resource_url)}")
{:error, :unknown_resource}