aio-libs / aio-libs/aiohttp

Include history for all client errors raised when fetching a URL

未关闭
#9,529 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
16.5k
派生
2.4k
平均合并
20 小时 10 分钟
30 天内合并 PR
221

描述

### Is your feature request related to a problem?

Currently, if we attempt to fetch a URL with a bad redirect that raises a DNS resolution error for which the root cause lies with a redirect, we cannot figure out the full redirect chain. Practically, imagine the following redirect chain, where the end does not resolve:

http://foo.com -> http://www.foo.com -> https://www.www.foo.com/test

A `get()` call will raise a `ClientConnectorDNSError`, and if we dig into it we can indeed find out the DNS resolution failed for www.www.foo.com, hinting at the fact we were redirected. This information is however incomplete:

* We don't know we went through http://www.foo.com in the process
* We don't know the path was `/test`
* We don't know the precise status codes of the redirects (301, 302, etc.)

### Describe the solution you'd like

I would like to have history available for all errors where history has been generated before raising the error.

### Describe alternatives you've considered

None are available, as far as I know.

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。