From 6bd5529afe1b9c2391e16a0cd4150c361871bbd1 Mon Sep 17 00:00:00 2001 From: Folarin Benjamen Pelumi <89490327+Benflow3@users.noreply.github.com> Date: Wed, 17 Jun 2026 01:05:32 +0100 Subject: [PATCH 1/2] Update body_snapshot docstring for clarity Clarify behavior of body_snapshot method for LoggableResponseBody. --- .../dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py b/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py index 49f57fc..3af1043 100644 --- a/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py +++ b/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py @@ -112,9 +112,9 @@ def _status_is_retryable(self) -> bool: def body_snapshot(self, max_bytes: int | None = None) -> bytes: """Preview the error response body without consuming it. - Safe to call from logging and post-mortem paths: it never drains a - single-use stream. Bytes are only returned when the body has already - been captured for repeatable reads (a ``LoggableResponseBody``); for + For a LoggableResponseBody, the snapshot drains and caches the inner + body on the first access (this initial read is synchronous and + may incur I/O, but subsequent reads are repeatable and fast); for any other body — or when no response/body is present — an empty ``bytes`` is returned rather than destroying the payload. From 2c6d0e92eb861102068ff0572e71d1d45741bff1 Mon Sep 17 00:00:00 2001 From: Folarin Benjamen Pelumi <89490327+Benflow3@users.noreply.github.com> Date: Wed, 17 Jun 2026 03:18:15 +0100 Subject: [PATCH 2/2] docs: fix formatting in body_snapshot docstring Wrap LoggableResponseBody in double backticks --- packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py b/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py index 3af1043..ac93d6b 100644 --- a/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py +++ b/packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py @@ -112,7 +112,7 @@ def _status_is_retryable(self) -> bool: def body_snapshot(self, max_bytes: int | None = None) -> bytes: """Preview the error response body without consuming it. - For a LoggableResponseBody, the snapshot drains and caches the inner + For a ``LoggableResponseBody``, the snapshot drains and caches the inner body on the first access (this initial read is synchronous and may incur I/O, but subsequent reads are repeatable and fast); for any other body — or when no response/body is present — an empty