Log error response body in debug

This commit is contained in:
Radon Rosborough 2025-08-26 21:19:28 -07:00 committed by Hugo
parent 388c16f188
commit 84ff0ac943

View file

@ -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):