Change error response: timeoutResult => emptyResult
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/5acead83 Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/5acead83 Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/5acead83 Branch: refs/heads/feature/test_daewon Commit: 5acead832ad9506f08feca0b47dc1aeaf847dc33 Parents: b5b8fcb Author: daewon <[email protected]> Authored: Mon Dec 21 14:13:31 2015 +0900 Committer: daewon <[email protected]> Committed: Mon Dec 21 14:13:31 2015 +0900 ---------------------------------------------------------------------- s2rest_netty/src/main/scala/Server.scala | 3 ++- s2rest_play/app/controllers/ApplicationController.scala | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/5acead83/s2rest_netty/src/main/scala/Server.scala ---------------------------------------------------------------------- diff --git a/s2rest_netty/src/main/scala/Server.scala b/s2rest_netty/src/main/scala/Server.scala index 39540d0..3f1e70a 100644 --- a/s2rest_netty/src/main/scala/Server.scala +++ b/s2rest_netty/src/main/scala/Server.scala @@ -94,7 +94,8 @@ class S2RestHandler(s2rest: RestCaller)(implicit ec: ExecutionContext) extends S simpleResponse(ctx, Ok, byteBufOpt = Option(buf), channelFutureListenerOpt = Option(Close), headers = defaultHeaders) case e: Exception => logger.error(s"${jsonQuery}, ${e.getMessage}", e) - simpleResponse(ctx, InternalServerError, byteBufOpt = None, channelFutureListenerOpt = Option(Close)) + val buf: ByteBuf = Unpooled.copiedBuffer(PostProcess.emptyResults.toString, CharsetUtil.UTF_8) + simpleResponse(ctx, InternalServerError, byteBufOpt = Option(buf), channelFutureListenerOpt = Option(Close), headers = defaultHeaders) } } } http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/5acead83/s2rest_play/app/controllers/ApplicationController.scala ---------------------------------------------------------------------- diff --git a/s2rest_play/app/controllers/ApplicationController.scala b/s2rest_play/app/controllers/ApplicationController.scala index ec21216..484d282 100644 --- a/s2rest_play/app/controllers/ApplicationController.scala +++ b/s2rest_play/app/controllers/ApplicationController.scala @@ -21,7 +21,7 @@ object ApplicationController extends Controller { Future.successful(BadRequest(Json.obj("message" -> ex.getMessage)).as(applicationJsonHeader)) private def errorResults = - Future.successful(Ok(PostProcess.timeoutResults).as(applicationJsonHeader)) + Future.successful(Ok(PostProcess.emptyResults).as(applicationJsonHeader)) def requestFallback(body: JsValue): PartialFunction[Throwable, Future[Result]] = { case e: BadQueryException =>
