aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-12-20 10:28:43 +0200
committerGravatar ks129 <[email protected]>2020-12-20 10:28:43 +0200
commit4527f9a674a28952d1da670e934921d12cdc14b6 (patch)
tree3fbb14f2f65ccd9a618034d5e881ad8e59558367
parentMake last PEPs listing refresh non-optional (diff)
Log warning and return early when can't get PEP URLs from API
-rw-r--r--bot/exts/utils/pep.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/utils/pep.py b/bot/exts/utils/pep.py
index e0b06d63e..d642c902a 100644
--- a/bot/exts/utils/pep.py
+++ b/bot/exts/utils/pep.py
@@ -39,6 +39,10 @@ class PythonEnhancementProposals(Cog):
self.last_refreshed_peps = datetime.now()
async with self.bot.http_session.get(self.PEPS_LISTING_API_URL) as resp:
+ if resp.status != 200:
+ log.warning(f"Fetching PEP URLs from GitHub API failed with code {resp.status}")
+ return
+
listing = await resp.json()
log.trace("Got PEP URLs listing from GitHub API")