Skip to content

Add unique exceptions for different timeouts #7801

Closed
@Hessamshar

Description

Is your feature request related to a problem?

Currently a connection pool timeout and a socket read timeout raise the same exception (aiohttp.ServerTimeoutError). This is not ideal since in our app we would like to apply different logic for different kinds of timeouts but currently it is not possible.

Inherently, a request going through but timing out while getting processed in the target is a much different issue than it timing out establishing a connection to the target. Treating these two different problems the same way is not ideal.

Describe the solution you'd like

Define unique exceptions for all kinds of timeouts.

Describe alternatives you've considered

Time how long it takes for the request to timeout locally, if we get aiohttp.ServerTimeoutError and the time to timeout is less than equal to the connect timeout, then it is potentially a connect timeout.

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions