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

Wrong pat match failed DatabaseQuery.call #917

Open
shinnokdisengir opened this issue Mar 25, 2024 · 0 comments
Open

Wrong pat match failed DatabaseQuery.call #917

shinnokdisengir opened this issue Mar 25, 2024 · 0 comments
Labels
app:realm_management This issue or pull request is about astarte_realm_management application internals This issue or pull request is about implementation details

Comments

@shinnokdisengir
Copy link
Contributor

shinnokdisengir commented Mar 25, 2024

Description

Some DatabaseQuery.call failure pattern matching never match. The function always returns {:error, _} when it fails.

Expected Behavior

with {:ok, _result} <- DatabaseQuery.call(client, batch) do
  :ok
else
  {:error, reason} ->
    error_message =
      case reason do
        %{acc: _, msg: error_msg} -> error_msg
        _ -> inspect(reason)
      end

    Logger.warning("Failed batch due to database error: #{error_message}.", tag: "db_error")
    {:error, :database_error}
end

Current Behavior

see here:


@shinnokdisengir shinnokdisengir added the app:realm_management This issue or pull request is about astarte_realm_management application label Mar 25, 2024
@Annopaolo Annopaolo added the internals This issue or pull request is about implementation details label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:realm_management This issue or pull request is about astarte_realm_management application internals This issue or pull request is about implementation details
Projects
Status: No status
Development

No branches or pull requests

2 participants