From 84ff0ac943eee4fc20578d97d617dae685e388f0 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Tue, 26 Aug 2025 21:19:28 -0700 Subject: [PATCH] Log error response body in debug --- vdirsyncer/http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vdirsyncer/http.py b/vdirsyncer/http.py index 108ef86..51d451c 100644 --- a/vdirsyncer/http.py +++ b/vdirsyncer/http.py @@ -223,6 +223,10 @@ async def request( logger.debug(response.headers) logger.debug(response.content) + if logger.getEffectiveLevel() <= logging.DEBUG and response.status >= 400: + # https://github.com/pimutils/vdirsyncer/issues/1186 + logger.debug(await response.text()) + if response.status == 412: raise exceptions.PreconditionFailed(response.reason) if response.status in (404, 410):