fix Shadowing outer local variable response
This commit is contained in:
parent
73c84baf9f
commit
1954463371
1 changed files with 4 additions and 4 deletions
|
@ -648,11 +648,11 @@ module YoutubeAPI
|
||||||
puts "invidious companion section"
|
puts "invidious companion section"
|
||||||
puts invidious_companion_urls[Random.rand(invidious_companion_urls.size)]
|
puts invidious_companion_urls[Random.rand(invidious_companion_urls.size)]
|
||||||
begin
|
begin
|
||||||
response = make_client(URI.parse(invidious_companion_urls[Random.rand(invidious_companion_urls.size)]),
|
invidious_companion_response = make_client(URI.parse(invidious_companion_urls[Random.rand(invidious_companion_urls.size)]),
|
||||||
&.post(endpoint, headers: headers, body: data.to_json))
|
&.post(endpoint, headers: headers, body: data.to_json))
|
||||||
body = response.body
|
body = invidious_companion_response.body
|
||||||
if (response.status_code != 200)
|
if (invidious_companion_response.status_code != 200)
|
||||||
raise Exception.new("status code: " + response.status_code.to_s + " and body: " + body)
|
raise Exception.new("status code: " + invidious_companion_response.status_code.to_s + " and body: " + body)
|
||||||
end
|
end
|
||||||
rescue ex
|
rescue ex
|
||||||
raise InfoException.new("Error while communicating with Invidious companion: " + (ex.message || "no extra info found"))
|
raise InfoException.new("Error while communicating with Invidious companion: " + (ex.message || "no extra info found"))
|
||||||
|
|
Loading…
Reference in a new issue