mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
fix status code check
This commit is contained in:
@@ -45,7 +45,7 @@ async def close_client(_client: AsyncClient) -> None:
|
|||||||
async def fetch_json(_client: AsyncClient, url: str) -> dict:
|
async def fetch_json(_client: AsyncClient, url: str) -> dict:
|
||||||
logger.info(f"Fetching {url}")
|
logger.info(f"Fetching {url}")
|
||||||
response = await _client.get(url)
|
response = await _client.get(url)
|
||||||
assert response.status_code == response.is_success, f"Failed to fetch {url}, status code {response.status_code}"
|
assert response.is_success, f"Failed to fetch {url}, status code {response.status_code}"
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user