Log useful information when a response fails to parse
MODIFY
README.md
README.md
@@ -360,7 +360,7 @@ clusters.
./all_tests.sh
```
-##### Kafka >= 0.9.0
+##### Kafka = 0.9.0
The 0.9 client includes functionality that cannot be tested with older
clusters.

MODIFY
lib/kafka_ex/server.ex
lib/kafka_ex/server.ex
@@ -839,8 +839,27 @@ defmodule KafkaEx.Server do
config_sync_timeout()
)
|> case do
- {:error, reason} -> {:error, reason}
- response -> module.parse_response(response)
+ {:error, reason} ->
+ {:error, reason}
+
+ response ->
+ try do
+ module.parse_response(response)
+ rescue
+ _ ->
+ Logger.error(
+ "Failed to parse a response from the server: #{
+ inspect(response)
+ }"
+ )
+
+ Kernel.reraise(
+ "Parse error during #{inspect(module)}.parse_response. Couldn't parse: #{
+ inspect(response)
+ }",
+ __STACKTRACE__
+ )
+ end
end
state_out = State.increment_correlation_id(updated_state)

MODIFY
test/test_helper.exs
test/test_helper.exs
@@ -6,6 +6,7 @@ ExUnit.configure(
integration: true,
consumer_group: true,
server_0_p_10_p_1: true,
+ server_0_p_10_and_later: true,
server_0_p_9_p_0: true,
server_0_p_8_p_0: true
]

Log useful information when a response fails to parse