Skip to content

Commit

Permalink
rewording messages (we don't have expected now)
Browse files Browse the repository at this point in the history
  • Loading branch information
PyExplorer committed Oct 18, 2024
1 parent 70e9b55 commit 11dd745
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scrapy_zyte_api/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,21 @@ def from_api_response(


def _body_max_size_exceeded(
expected_size: int,
body_size: int,
warnsize: Optional[int],
maxsize: Optional[int],
request_url: str,
) -> bool:
if warnsize and expected_size > warnsize:
if warnsize and body_size > warnsize:
logger.warning(
f"Expected response size {expected_size} larger than "
f"Actual response size {body_size} larger than "
f"download warn size {warnsize} in request {request_url}."
)

if maxsize and expected_size > maxsize:
if maxsize and body_size > maxsize:
logger.warning(
f"Cancelling download of {request_url}: expected response size "
f"{expected_size} larger than download max size {maxsize}."
f"Cancelling download of {request_url}: actual response size "
f"{body_size} larger than download max size {maxsize}."
)
return True
return False
Expand Down

0 comments on commit 11dd745

Please sign in to comment.