Skip to content

Commit 207bd56

Browse files
authored
chore(bdba): Properly log response object in case of errors (#866)
Signed-off-by: Jonas Brand (8R0WNI3) <j.brand@sap.com>
1 parent 0c363d7 commit 207bd56

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/bdba/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,12 @@ def increment(
177177
retry = super().increment(method, url, response, error, _pool, _stacktrace)
178178
# Use the Retry history to determine the number of retries.
179179
num_retries = len(self.history) if self.history else 0
180+
status = response.status if response else None
181+
reason = response.reason if response else None
182+
content = response.data.decode() if response else None
180183
logger.warning(
181-
f'{method=} {url=} returned {response=} {error=} {num_retries=} - trying again',
184+
f'{method=} {url=} returned {status=} {reason=} {error=} {num_retries=} - trying again '
185+
f'({content=})',
182186
)
183187
return retry
184188

0 commit comments

Comments
 (0)