From 020f2fa10b1cda6f57b8bcaf527d46341dd680d4 Mon Sep 17 00:00:00 2001 From: Alyanna Santos Date: Tue, 3 Dec 2024 15:10:39 -0500 Subject: [PATCH] fix: log warning on unsuccesful response --- lib/graphql-hive/client.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/graphql-hive/client.rb b/lib/graphql-hive/client.rb index e54c53d..ea4ae28 100644 --- a/lib/graphql-hive/client.rb +++ b/lib/graphql-hive/client.rb @@ -24,6 +24,10 @@ def send(path, body, _log_type) request = build_request(uri, body) response = http.request(request) + if response.code.to_i != 200 + @options[:logger].warn("Unsuccessful response: #{response.code} - #{response.body}") + end + @options[:logger].debug(response.inspect) @options[:logger].debug(response.body.inspect) rescue => e