From 088e2c5af33210692a240b2b9dc1b0cdd3c6a6d6 Mon Sep 17 00:00:00 2001 From: fjy Date: Tue, 29 Jul 2014 13:36:28 -0700 Subject: [PATCH] address cr --- .../java/io/druid/server/AsyncQueryForwardingServlet.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java index e961cd453fe..cb2faa7acee 100644 --- a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java +++ b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java @@ -58,7 +58,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet { private static final EmittingLogger log = new EmittingLogger(AsyncQueryForwardingServlet.class); - private static void handleException(HttpServletResponse response, ObjectMapper objectMapper, Throwable exception) + private static void handleException(HttpServletResponse response, ObjectMapper objectMapper, Exception exception) throws IOException { if (!response.isCommitted()) { @@ -72,6 +72,8 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet ); } response.flushBuffer(); + + throw new IOException(exception); } private final ObjectMapper jsonMapper; @@ -134,6 +136,8 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet response.getOutputStream(), ImmutableMap.of("error", errorMessage) ); + + throw e; } catch (Exception e) { handleException(response, objectMapper, e);