Skip to content

ConnectionAbortedError/asyncio.CancelledError when the page's loading is canceled by the user is not catchable. #230

Description

@ignpoppyseed

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

Activity

  1. JerryHuang-LE commented on Sep 5, 2023

    @JerryHuang-LE

    not sure if it is the same issue with this one #266

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