@@ -362,22 +362,6 @@ def graphql_result_retryable?(result)
362362 result [ :code ] >= 500
363363 end
364364
365- # Helper: log `message` to `Entitlements.logger` at the given severity. Restricts
366- # the dispatch to a known set of severities so callers can pick a level computed
367- # at runtime without going through `send`/`public_send`.
368- #
369- # severity - Symbol, one of :warn or :error.
370- # message - String message to log.
371- #
372- # Returns nothing.
373- Contract C ::Or [ :warn , :error ] , String => C ::Any
374- def log_at_severity ( severity , message )
375- case severity
376- when :warn then Entitlements . logger . warn ( message )
377- when :error then Entitlements . logger . error ( message )
378- end
379- end
380-
381365 # Helper method: Do the HTTP POST to the GitHub API for GraphQL.
382366 #
383367 # query - String with the data to be posted.
@@ -401,9 +385,8 @@ def graphql_http_post_real(query)
401385 # The retry wrapper retries on 5xx, so log those at WARN to avoid misleading
402386 # the operator with an ERROR for a transient failure that we recover from.
403387 # Terminal non-2xx responses (4xx) stay at ERROR.
404- severity = response . code . start_with? ( "5" ) ? :warn : :error
405- log_at_severity ( severity , "Got HTTP #{ response . code } POSTing to #{ uri } " )
406- log_at_severity ( severity , response . body )
388+ msg = "POST to #{ uri } returned HTTP Code #{ response . code } and Body: #{ response . body } "
389+ response . code . start_with? ( "5" ) ? Entitlements . logger . warn ( msg ) : Entitlements . logger . error ( msg )
407390 return { code : response . code . to_i , data : { "body" => response . body } }
408391 end
409392
0 commit comments