Log errors that occured on the client side

This commit is contained in:
Alexis Métaireau 2023-10-05 11:10:39 +02:00
parent f038a37022
commit 835ee50c1f
2 changed files with 2 additions and 1 deletions

View file

@ -62,7 +62,7 @@ class HTTPBodyContains(BaseCheck):
async def run(self) -> dict:
response = await self.client.request(method="get", url=self.task.url)
return self.response(
self.expected in response.body
self.expected in response.text
)

View file

@ -21,6 +21,7 @@ async def complete_task(client: httpx.AsyncClient, task: dict) -> dict:
except Exception as e:
status = "error"
context = SerializableException.from_exception(e)
logger.error(f"An exception occured when trying to complete {task} : {e}")
return ClientResult(task=task.id, status=status, context=context)