youtube: Fix for HTTPError stub change.
https://github.com/python/typeshed/pull/10875 Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
ccda105d1d
commit
8abca34a05
1 changed files with 1 additions and 0 deletions
|
@ -34,6 +34,7 @@ class YoutubeHandler:
|
||||||
try:
|
try:
|
||||||
search_youtube("test", self.config_info["key"], self.config_info["video_region"])
|
search_youtube("test", self.config_info["key"], self.config_info["video_region"])
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
|
assert e.response is not None
|
||||||
if e.response.json()["error"]["errors"][0]["reason"] == "keyInvalid":
|
if e.response.json()["error"]["errors"][0]["reason"] == "keyInvalid":
|
||||||
bot_handler.quit(
|
bot_handler.quit(
|
||||||
"Invalid key." "Follow the instructions in doc.md for setting API key."
|
"Invalid key." "Follow the instructions in doc.md for setting API key."
|
||||||
|
|
Loading…
Add table
Reference in a new issue