Is it possible to reprocess a flask-request e.g. after handling an exception? If yes, how?

14 Views Asked by At

Assume we need to catch an OperationalError from SQLAlchemy, because the database had gone away and the session needs to be closed like this:

@APP.errorhandler(sqlalchemy.exc.OperationalError)
def handle_operationalerror(error):
    SESSION.close_all()
    --> now reprocess the request

How can restart the processing of the request from scratch?

Redirecting via a 3xx to the same URL won't help since I'm dealing with an SPA that does not honor 3xx

0

There are 0 best solutions below