Skip to content

Commit

Permalink
Merge branch 'log-on-unsuccessful-responses' of github.com:al-yanna/g…
Browse files Browse the repository at this point in the history
…raphql-ruby-hive into log-on-unsuccessful-responses
  • Loading branch information
al-yanna committed Dec 6, 2024
2 parents 53df58c + bd49ad3 commit 0024214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/graphql-hive/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def send(path, body, _log_type)
http = setup_http(uri)
request = build_request(uri, body)
response = http.request(request)

if response.code.to_i >= 400 && response.code.to_i < 500
code = response.code.to_i
if code >= 400 && code < 500
error_message = "Unsuccessful response: #{response.code} - #{response.message}"
extract_error_details(response)&.then { |details| error_message += ": [#{details}]" }
@options[:logger].warn(error_message)
Expand Down

0 comments on commit 0024214

Please sign in to comment.