From 25a5a0fd33233343d1398d4572e3b5682a6f93da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Tue, 29 Jul 2014 13:54:36 -0700 Subject: [PATCH] fix unnecessary error messages --- .../java/io/druid/server/AsyncQueryForwardingServlet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } }