Skip to content

look into read timeouts when sending to discord #4

@zml2008

Description

@zml2008

got this error:

 Traceback (most recent call last):
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
     yield
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
     resp = await self._pool.handle_async_request(req)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
     raise exc from None
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
     response = await connection.handle_async_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pool_request.request
         ^^^^^^^^^^^^^^^^^^^^
     )
     ^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/connection.py", line 103, in handle_async_request
     return await self._connection.handle_async_request(request)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 136, in handle_async_request
     raise exc
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 106, in handle_async_request
     ) = await self._receive_response_headers(**kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 177, in _receive_response_headers
     event = await self._receive_event(timeout=timeout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_async/http11.py", line 217, in _receive_event
     data = await self._network_stream.read(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         self.READ_NUM_BYTES, timeout=timeout
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     )
     ^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_backends/anyio.py", line 32, in read
     with map_exceptions(exc_map):
          ~~~~~~~~~~~~~~^^^^^^^^^
   File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
     self.gen.throw(value)
     ~~~~~~~~~~~~~~^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
     raise to_exc(exc) from exc
 httpcore.ReadTimeout
 
 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):
   File "/home/pydisgit/.local/lib/python3.13/site-packages/quart/app.py", line 1464, in handle_request
     return await self.full_dispatch_request(request_context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/quart/app.py", line 1502, in full_dispatch_request
     result = await self.handle_user_exception(error)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/quart/app.py", line 1059, in handle_user_exception
     raise error
   File "/home/pydisgit/.local/lib/python3.13/site-packages/quart/app.py", line 1500, in full_dispatch_request
     result = await self.dispatch_request(request_context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/quart/app.py", line 1597, in dispatch_request
     return await self.ensure_async(handler)(**request_.view_args)  # type: ignore[return-value]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/pydisgit/__init__.py", line 68, in gh_hook
     result = await http.post(f"https://discord.com/api/webhooks/{hook_id}/{token}", json = embed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1859, in post
     return await self.request(
            ^^^^^^^^^^^^^^^^^^^
     ...<13 lines>...
     )
     ^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1540, in request
     return await self.send(request, auth=auth, follow_redirects=follow_redirects)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1629, in send
     response = await self._send_handling_auth(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     ...<4 lines>...
     )
     ^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
     response = await self._send_handling_redirects(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     ...<3 lines>...
     )
     ^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
     response = await self._send_single_request(request)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_client.py", line 1730, in _send_single_request
     response = await transport.handle_async_request(request)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
     with map_httpcore_exceptions():
          ~~~~~~~~~~~~~~~~~~~~~~~^^
   File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
     self.gen.throw(value)
     ~~~~~~~~~~~~~~^^^^^^^
   File "/home/pydisgit/.local/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
     raise mapped_exc(message) from exc
 httpx.ReadTimeout

The message was still passed through to discord, do we just need to bump up timeouts

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