address cr

This commit is contained in:
fjy 2014-07-29 13:36:28 -07:00
parent b09517319d
commit 088e2c5af3
1 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet
{ {
private static final EmittingLogger log = new EmittingLogger(AsyncQueryForwardingServlet.class); 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 throws IOException
{ {
if (!response.isCommitted()) { if (!response.isCommitted()) {
@ -72,6 +72,8 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet
); );
} }
response.flushBuffer(); response.flushBuffer();
throw new IOException(exception);
} }
private final ObjectMapper jsonMapper; private final ObjectMapper jsonMapper;
@ -134,6 +136,8 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet
response.getOutputStream(), response.getOutputStream(),
ImmutableMap.of("error", errorMessage) ImmutableMap.of("error", errorMessage)
); );
throw e;
} }
catch (Exception e) { catch (Exception e) {
handleException(response, objectMapper, e); handleException(response, objectMapper, e);