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

ClientResponseError does not include URL #3959

Closed
dkliban opened this issue Aug 4, 2019 · 1 comment

Comments

@dkliban
Copy link
Contributor

commented Aug 4, 2019

Long story short

The string representation of ClientResponseErrors only includes the response code and message. It would be more useful for users seeing these errors in logs to know which URL produced the response.

Expected behaviour

File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/download/http.py", line 183, in _run
response.raise_for_status()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/aiohttp/client_reqrep.py", line 944, in raise_for_status
headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://badexample.com'

Actual behaviour

File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/plugin/download/http.py", line 183, in _run
response.raise_for_status()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/aiohttp/client_reqrep.py", line 944, in raise_for_status
headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'

Steps to reproduce

Make an GET request that you know will produce a 404. Don't handle the exception and then look at the stacktrace printed.

@asvetlov

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

Fixed by #3960

@asvetlov asvetlov closed this Aug 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.