Merge pull request #5771 from reitermarkus/github-no-content
Let `GitHub::open_api` return `nil` when status is `204 No Content`.
This commit is contained in:
commit
46c854bbcf
@ -209,6 +209,9 @@ module GitHub
|
|||||||
if !http_code.start_with?("2") || !status.success?
|
if !http_code.start_with?("2") || !status.success?
|
||||||
raise_api_error(output, errors, http_code, headers, scopes)
|
raise_api_error(output, errors, http_code, headers, scopes)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return if http_code == "204" # No Content
|
||||||
|
|
||||||
json = JSON.parse output
|
json = JSON.parse output
|
||||||
if block_given?
|
if block_given?
|
||||||
yield json
|
yield json
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user