diff --git a/services/core.py b/services/core.py index 12ad62c..395b41e 100644 --- a/services/core.py +++ b/services/core.py @@ -20,11 +20,12 @@ async def get_all_authors(): async with AsyncClient() as client: try: response = await client.post(API_BASE, headers=headers, json=gql) + print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes") except Exception: import traceback traceback.print_exc() - print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes") + if response.status_code != 200: return None r = response.json() @@ -45,12 +46,13 @@ async def get_my_followings(): } async with AsyncClient() as client: try: - response = await client.post(API_BASE, headers=headers, json=gql) + response = await client.post(API_BASE, headers=headers, json=gql) + print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes") except Exception: import traceback traceback.print_exc() - print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes") + if response.status_code != 200: return None r = response.json()