Add exception-catchers that point out exactly which game or channel causes a crash
This commit is contained in:
1 parent
dbd3cd82a0
commit
a536dde677
2 files changed
+19
-13
No files matched your search
+6
-3
@@ -244,9 +244,12 @@ class Channel:
|
||||
return URLType(match.group(1))
|
||||
|
||||
async def get_stream(self) -> Stream | None:
|
||||
response: JsonType = await self._twitch.gql_request(
|
||||
GQL_OPERATIONS["GetStreamInfo"].with_variables({"channel": self._login})
|
||||
)
|
||||
try:
|
||||
response: JsonType = await self._twitch.gql_request(
|
||||
GQL_OPERATIONS["GetStreamInfo"].with_variables({"channel": self._login})
|
||||
)
|
||||
except MinerException as exc:
|
||||
raise MinerException(f"Channel: {self._login}") from exc
|
||||
stream_data: JsonType | None = response["data"]["user"]
|
||||
if not stream_data:
|
||||
return None
|
||||
|
||||
Reference in new issue
Block a user