I am testing the following code in the 2.4 framework:
def error = Action {
val enumerator = Enumerator.outputStream { os =>
throw new Exception()
}
Ok.stream(enumerator >>> Enumerator.eof).withHeaders(
CONTENT_TYPE -> "text/plain"
)
}
When outputStreaman exception is thrown in the function passed to , the enumerator passed in Ok.streamalways hangs. How to fix it?
source
share