Correct way to notify http client of error after partial response has been sent in Java http

27 Views Asked by At

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.

0

There are 0 best solutions below