Capturing errors in Flask but continuing with the request as normal
I figured it's probably not possible.
It's not possible for the server to receive the entire request as it has to terminate the connection once the max_content_length threshold has been passed, discarding any other form data that would have been sent after the file upload. The server resets the connection with a HTTP 413 status code. While it appears it's possible to register a function to handle HTTP 413  errors (and presumably to return a custom error page), this doesn't work in Flask. I assume this is a bug.
I've read through the docs and Googled my problem, but I don't seem to be able to figure out a way to handle errors in Flask without terminating the request and displaying an error page.
The error I want to handle is werkzeug.exceptions.RequestEntityTooLarge which is raised when a file upload exceeds the specified limit. Ideally I want to be able to add an element to the flask.request.files dictionary indicating that the uploaded file exceeded the maximum upload size. The error could then be presented inline with the original form so the user can try again.
Is this even possible in Flask?