Skip to content

Add ClientResponse().history elements to ClientResponseError #1741

Closed
@penguinolog

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]

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions