Skip to content

Commit

Permalink
once more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jondthomas committed Dec 10, 2024
1 parent 7560c0a commit 55ba7f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/kafee/consumer/broadway_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,12 @@ defmodule Kafee.Consumer.BroadwayAdapter do
# function above because `Kafee.Consumer.Adapter.push_message/2` will catch any
# errors.

error = %RuntimeError{message: "Error converting a Broadway message to Kafee.Consumer.Message"}
messages |> List.wrap() |> Enum.each(&consumer.handle_failure(error, &1))
messages
|> List.wrap()
|> Enum.each(fn message ->
error = %RuntimeError{message: "Error occurred processing a message - #{inspect(message.status)}"}
consumer.handle_failure(error, message)
end)

messages
end
Expand Down
4 changes: 3 additions & 1 deletion test/kafee/consumer/broadway_adapter_integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ defmodule Kafee.Consumer.BroadwayAdapterIntegrationTest do

assert_receive message
IO.inspect(message)

Check warning on line 132 in test/kafee/consumer/broadway_adapter_integration_test.exs

View workflow job for this annotation

GitHub Actions / Credo

There should be no calls to IO.inspect/1.
assert_receive {:error_reason, "%RuntimeError{message: \"Error handling a message for key-fail-2\"}"}

assert_receive {:error_reason,
"%RuntimeError{message: \"Error converting a Broadway message to Kafee.Consumer.Message\"}"}
end
end
end

0 comments on commit 55ba7f7

Please sign in to comment.