utils/github: fix GraphQL error log

The key `type` is not included in the response, making the log look weird.
This commit is contained in:
zyoshoka 2025-02-01 00:37:52 +09:00
parent f778d217f0
commit 8aa22ea939
No known key found for this signature in database
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