Merge pull request #19182 from zyoshoka/utils/github/fix-graphql-error-log

utils/github: fix GraphQL error log
This commit is contained in:
Mike McQuaid 2025-01-31 15:50:59 +00:00 committed by GitHub
commit d672589330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View File

@ -480,9 +480,7 @@ module GitHub
end
# Only raise errors if we didn't get any sponsorships.
if sponsorships.blank? && errors.present?
raise API::Error, errors.map { |e| "#{e["type"]}: #{e["message"]}" }.join("\n")
end
raise API::Error, errors.map { |e| e["message"] }.join("\n") if sponsorships.blank? && errors.present?
sponsorships.map do |sponsorship|
sponsor = sponsorship["sponsorEntity"]

View File

@ -329,9 +329,7 @@ module GitHub
result = open_rest("#{API_URL}/graphql", scopes:, data:, request_method: "POST")
if raise_errors
if result["errors"].present?
raise Error, result["errors"].map { |e| "#{e["type"]}: #{e["message"]}" }.join("\n")
end
raise Error, result["errors"].map { |e| e["message"] }.join("\n") if result["errors"].present?
result["data"]
else