We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client connection failure is not handled properly when I'm trying to connect to a server which is not running.
import asyncio from aiohttp_sse_client import client as sse_client async def main(): async with sse_client.EventSource( url="http://no-such-url", max_connect_retry=1 ) as event_source: async for event in event_source: print(event) asyncio.run(main()) # aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host no-such-url:80 ssl:default [Name or service not known] # Unclosed client session # client_session: <aiohttp.client.ClientSession object at 0x7f9c9e5d7070>
Temporary solution - passing custom session object. The session is getting closed after exception raised.
import asyncio from aiohttp import ClientSession from aiohttp_sse_client import client as sse_client async def main(): url = "http://no-such-url" async with ClientSession() as session: async with sse_client.EventSource( url=url, session=session, max_connect_retry=1 ) as event_source: async for event in event_source: print(event) asyncio.run(main())
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Client connection failure is not handled properly when I'm trying to connect to a server which is not running.
What I Did
Temporary solution - passing custom session object. The session is getting closed after exception raised.
The text was updated successfully, but these errors were encountered: