Skip to content

Commit

Permalink
youtube: Fix for HTTPError stub change.
Browse files Browse the repository at this point in the history
python/typeshed#10875

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk committed Oct 18, 2023
1 parent ccda105 commit 8abca34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions zulip_bots/zulip_bots/bots/youtube/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def initialize(self, bot_handler: BotHandler) -> None:
try:
search_youtube("test", self.config_info["key"], self.config_info["video_region"])
except HTTPError as e:
assert e.response is not None
if e.response.json()["error"]["errors"][0]["reason"] == "keyInvalid":
bot_handler.quit(
"Invalid key." "Follow the instructions in doc.md for setting API key."
Expand Down

0 comments on commit 8abca34

Please sign in to comment.