Skip to content

Inconsistent Timeout Exception #3017

Closed
Closed

Description

@ChihweiLHBird

httpx.get("https://www.google.com", timeout=0.0000001) raises:
httpx.ConnectError: [Errno 65] No route to host
(NOT a sub-class of TimeoutException)

httpx.get("https://www.google.com", timeout=0.05) raises:
httpx.ConnectTimeout: _ssl.c:983: The handshake operation timed out
(a sub-class of TimeoutException)

httpx.get("https://www.google.com", timeout=0.015) raises:
httpx.ReadTimeout: The read operation timed out
(a sub-class of TimeoutException)

Your mileage may vary depends on the latency between your location and the Google server.

I think ideally all timeouts of operation should raise a consistent exception (sub-class of TimeoutException) from the httpx client.

Activity

  1. locked and limited conversation to collaborators on Dec 21, 2023
  2. converted this issue into a discussion #3018 on Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions