Update packages, add error logs on connection issue

This commit is contained in:
Deko
2023-12-30 17:47:29 +01:00
parent c554b1815e
commit 284e7ad408
4 changed files with 332 additions and 313 deletions

View File

@@ -116,8 +116,10 @@ class TwitchClient:
},
params={"user_login": self.streamer},
)
except requests.exceptions.ConnectionError:
logger.warning("Twitch API is not reachable at the moment.")
except requests.exceptions.ConnectionError as err:
logger.opt(exception=err).warning(
"Getting streams failed with a connection Error, more details below."
)
return None
if response.status_code == 401:
@@ -162,8 +164,10 @@ class TwitchClient:
},
params={"user_id": user_id},
)
except NewConnectionError:
logger.warning("Twitch API is not reachable at the moment.")
except NewConnectionError as err:
logger.opt(exception=err).warning(
"Getting vods failed with a new connection Error, more details below."
)
return None
if response.status_code == 401: