Skip to content

Commit 6bd5529

Browse files
authored
Update body_snapshot docstring for clarity
Clarify behavior of body_snapshot method for LoggableResponseBody.
1 parent 86b742d commit 6bd5529

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/dexpace-sdk-core/src/dexpace/sdk/core/errors

packages/dexpace-sdk-core/src/dexpace/sdk/core/errors/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ def _status_is_retryable(self) -> bool:
112112
def body_snapshot(self, max_bytes: int | None = None) -> bytes:
113113
"""Preview the error response body without consuming it.
114114
115-
Safe to call from logging and post-mortem paths: it never drains a
116-
single-use stream. Bytes are only returned when the body has already
117-
been captured for repeatable reads (a ``LoggableResponseBody``); for
115+
For a LoggableResponseBody, the snapshot drains and caches the inner
116+
body on the first access (this initial read is synchronous and
117+
may incur I/O, but subsequent reads are repeatable and fast); for
118118
any other body — or when no response/body is present — an empty
119119
``bytes`` is returned rather than destroying the payload.
120120

0 commit comments

Comments
 (0)