mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-13 16:18:29 +00:00
YoutubeAPI: add logging on API error
This commit is contained in:
parent
68d69df6d3
commit
56ba453d95
@ -410,6 +410,11 @@ module YoutubeAPI
|
||||
code = initial_data["error"]["code"]
|
||||
message = initial_data["error"]["message"].to_s.sub(/(\\n)+\^$/, "")
|
||||
|
||||
# Logging
|
||||
LOGGER.error("YoutubeAPI: Got error #{code} when requesting #{endpoint}")
|
||||
LOGGER.error("YoutubeAPI: #{message}")
|
||||
LOGGER.info("YoutubeAPI: POST data was: #{data.to_s}")
|
||||
|
||||
raise InfoException.new("Could not extract JSON. Youtube API returned \
|
||||
error #{code} with message:<br>\"#{message}\"")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user