What is the correct behavior for an HTTP server if an error occurs while writing a streaming response to the client? Say for example, the server wrote part of the body to response outputstream and the response is committed with a 200 status code. While generating another chunk of the response body, we encounter an error on the server. Is there a mechanism to return an indicator to the browser that the content is not complete because of an error on the server?
In my particular usecase I am requesting a dynamically generated JavaScript file using a script tag.