标签: scala caching spray spray-routing
答案 0 :(得分:0)
以下工作
而不是做
ctx.complete(ErrorCode, Error)
确实
ctx.failWith(Error)
价:
(1)https://github.com/spray/spray/blob/master/spray-caching/src/main/scala/spray/caching/LruCache.scala#L79
使用failWith设置值isFailure,因此高速缓存未完成
failWith
isFailure
(2)http://spray.io/documentation/1.2.2/spray-routing/route-directives/failWith/
要维护正确的状态代码,可以使用上面链接