From b7b56e5344456086e9f7568f4ec58fef390e87f1 Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" <445208+alexjc@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:46:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9E=20Convert=20exceptions=20to=20stri?= =?UTF-8?q?ng=20so=20they=20pickle.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/weboptout/http.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/weboptout/http.py b/src/weboptout/http.py index 8e6e23f..17f4d55 100644 --- a/src/weboptout/http.py +++ b/src/weboptout/http.py @@ -47,7 +47,7 @@ async def _fetch_from_cache_or_network(client, url: str) -> tuple: try: html = await response.text() except UnicodeDecodeError as exc: - report(S.ValidateContentEncoding, fail=True, exception=exc) + report(S.ValidateContentEncoding, fail=True, exception=str(exc)) report(S.ValidateContentLength, fail=len(html) == 0, bytes=len(html)) @@ -55,15 +55,15 @@ async def _fetch_from_cache_or_network(client, url: str) -> tuple: except asyncio.exceptions.TimeoutError as exc: with client.setup_log() as report: - report(S.ResolveDomain, fail=True, exception=exc) + report(S.ResolveDomain, fail=True, exception=str(exc)) except aiohttp.ClientError as exc: with client.setup_log() as report: - report(S.EstablishConnection, fail=True, exception=exc) + report(S.EstablishConnection, fail=True, exception=str(exc)) except AssertionError as exc: with client.setup_log() as report: - report(S.EstablishConnection, fail=True, exception=exc) + report(S.EstablishConnection, fail=True, exception=str(exc)) return url, {}, None