Skip to content

Conversation

jallum
Copy link
Contributor

@jallum jallum commented Feb 14, 2025

FunctionClauseError: no function clause matching in Meilisearch.Error.cast/1
  File "lib/meilisearch/error.ex", line 135, in Meilisearch.Error.cast/1
  File "lib/meilisearch/client.ex", line 58, in Meilisearch.Client.handle_response/1
  File "lib/meilisearch/search.ex", line 148, in Meilisearch.Search.search/3

@BlitzBanana
Copy link
Member

@jallum we could just match anything that's not a map :

  def cast(data) when is_map(data) do
    %__MODULE__{}
    |> Ecto.Changeset.cast(data, [:message, :link, :type, :code])
    |> Ecto.Changeset.apply_changes()
  end

  def cast(_), do: nil

If you agree, could you update the PR ?

@BlitzBanana BlitzBanana merged commit 451a132 into nutshell-lab:main Feb 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants