diff --git a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java index cb2faa7acee..f284a276202 100644 --- a/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java +++ b/server/src/main/java/io/druid/server/AsyncQueryForwardingServlet.java @@ -72,8 +72,6 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet ); } response.flushBuffer(); - - throw new IOException(exception); } private final ObjectMapper jsonMapper; @@ -132,15 +130,17 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet ) ); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); + response.setContentType(QueryResource.APPLICATION_JSON); objectMapper.writeValue( response.getOutputStream(), ImmutableMap.of("error", errorMessage) ); - throw e; + return; } catch (Exception e) { handleException(response, objectMapper, e); + return; } }