Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COL-8508 - FunctionClauseError: no function clause matching in Meilisearch.Error.cast/1 #26

Merged
merged 2 commits into from
Feb 14, 2025

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