Add ClientResponse().history elements to ClientResponseError #1741
Closed
Description
Long story short
During investigation of HTTP client exceptions on big installations, history can provide information about failure reason (incorrect redirect and etc).
De-facto needed fields:
url, code, reason, location if present in headers (all headers is better)
Expected behaviour
Accessible list ClientResponseError().history
Actual behaviour
Currently this information is unavailable.
Proposed solution:
HistoryRecord = namedtuple('HistoryRecord', ('url', 'code', 'reason', 'headers'))
ClientResponseError().history: typing.List[HistoryRecord]