This commit is contained in:
kiriharu 2021-01-09 01:41:21 +03:00
parent e61c7caab5
commit 4931730a8e

View File

@ -62,9 +62,13 @@ async def send_api_request(client: AsyncClient, endpoint: str, data: dict, node:
f"{node.address}/{endpoint}", params=data
)
except Exception as e:
# Remove token from log data
del data["token"]
logger.error(f"Node {node.address} got Error. Data: {data}. Endpoint: {endpoint}. Full exception: {e}")
result = Response(500)
await send_message_to_admins(f"Node {node.address} got error {e}. Full exception: ```{format_exc()}```")
await send_message_to_admins(f"Node {node.address} got error {e}. \n"
f"Data: {data}, Endpoint: {endpoint}\n"
f"Full exception: ```{format_exc()}```")
await push_api_request_status(
result.status_code,
endpoint