Jaa*_*aap 5 scala playframework
我在play框架2.4中测试以下代码:
def error = Action {
val enumerator = Enumerator.outputStream { os =>
// some operations that...
throw new Exception()
}
Ok.stream(enumerator >>> Enumerator.eof).withHeaders(
CONTENT_TYPE -> "text/plain"
)
}
Run Code Online (Sandbox Code Playgroud)
当传递给函数抛出异常时,传入outputStream的枚举器Ok.stream将永久挂起.我该怎么解决这个问题?
| 归档时间: |
|
| 查看次数: |
296 次 |
| 最近记录: |