Merge pull request #19182 from zyoshoka/utils/github/fix-graphql-error-log
utils/github: fix GraphQL error log
This commit is contained in:
		
						commit
						d672589330
					
				@ -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"]
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user