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
following this discussion
https://discord.com/channels/919193495116337154/1256638718236823593
we could make the below mvce simpler and catch a HTTPDisconnect instead of forcing the user to use anyio CancelledError (see @provinzkraut answer here: https://discord.com/channels/919193495116337154/1256638718236823593/1256895758255521804)
HTTPDisconnect
CancelledError
No response
@get("/foo") async def foo(db_pool: Pool, db_connection: Connection) -> Stream: stream_id = await db_connection.fetchval( """insert into toto(stream) values ('') returning id""" ) print(stream_id) async def chunks(num, stream_id): async with db_pool.acquire() as conn: try: for i in range(num): chunk = f"chunk #{i}\n" yield chunk await asyncio.sleep(0.5) update = await conn.execute( f"update toto set stream = '{i}' where id={stream_id}" ) print(update) except CancelledError as e: print(str(e)) with CancelScope(shield=True): delete = await conn.execute(f"delete from toto where id={id}") print(delete) raise finally: print("end") return Stream(chunks(10, stream_id))
1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
2.9.0
Note
While we are open for sponsoring on GitHub Sponsors and OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
following this discussion
https://discord.com/channels/919193495116337154/1256638718236823593
we could make the below mvce simpler and catch a
HTTPDisconnect
instead of forcing the user to use anyioCancelledError
(see @provinzkraut answer here: https://discord.com/channels/919193495116337154/1256638718236823593/1256895758255521804)URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
No response
Litestar Version
2.9.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: