ConnectionAbortedError/asyncio.CancelledError when the page's loading is canceled by the user is not catchable.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start by running the issue's Quart example with Python 3.11.2, canceling the request during asyncio.sleep, and examining the linked traceback. Trace how the canceled request reaches Quart's error handling and compare that path with @app.errorhandler(ConnectionAbortedError). Done means cancellation is either suppressed as intended or exposes a documented, usable handling path without an uncaught error.
Written by the indexing model from the issue text.
Description
The error ConnectionAbortedError is thrown if the page's loading is canceled. Using @app.errorhandler(ConnectionAbortedError) with an appropriate function is completely ignored. How do I handle (or just suppress) this error?
reproducible example:
from quart import Quart
from time import sleep
import asyncio
app = Quart(__name__)
@app.route('/')
async def hello():
await asyncio.sleep(1)
return 'Hello, world!'
if __name__ == '__main__':
app.run()
reproduce the bug:
run the script. connect to localhost:5000. cancel the load when the page is loading.
traceback: https://pastebin.com/aueksHyg
this error should not be thrown (or there needs to be a way to catch it.)
Environment:
- Python version: 3.11.2
- Quart version: 0.18.4
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pallets/quart
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/sig-end-user#406 ·
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100