Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add URL to Logs when Retrying #57

Open
BurnzZ opened this issue Dec 20, 2023 · 0 comments
Open

Add URL to Logs when Retrying #57

BurnzZ opened this issue Dec 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@BurnzZ
Copy link
Contributor

BurnzZ commented Dec 20, 2023

Currently, this section of the code https://github.com/zytedata/python-zyte-api/blob/main/zyte_api/aio/client.py#L62-L130 produces this DEBUG log when retrying errors:

[zyte_api.aio.retry] Retrying zyte_api.aio.client.AsyncClient.request_raw.<locals>.request in 7.430951650096189 seconds as it raised RequestError: RequestError: 520, message=, headers=<CIMultiDictProxy('Date': 'Tue, 19 Dec 2023 09:07:00 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '301', 'Connection': 'keep-alive', 'Retry-After': '60', 'Request-Id': '8dc64f033de37f442807c9d378c5044b', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Expose-Headers': '*, X-Project-Key', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range, Authorization, X-Project-Key', 'Access-Control-Max-Age': '1728000')>, body=b'{"type":"/download/temporary-error","title":"Temporary Downloading Error","status":520,"detail":"There is a downloading problem which might be temporary. Retry in N seconds from \'Retry-After\' header or open a support ticket from https://support.zyte.com/support/tickets/new if it fails consistently."}', request_id=8dc64f033de37f442807c9d378c5044b.

Notice that the URL of the request in isn't logged here, but the header is.

@BurnzZ BurnzZ added the enhancement New feature or request label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant