Inspect all Throwables for TimeoutException

pull/139/merge
Andrew Gaul 2016-06-26 23:23:13 -07:00
rodzic 3bfe5302a5
commit 1513606992
1 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

@ -267,17 +267,6 @@ final class S3ProxyHandler extends AbstractHandler {
httpResponse.getStatusCode());
baseRequest.setHandled(true);
return;
} catch (IOException ioe) {
if (Throwables2.getFirstThrowableOfType(ioe,
TimeoutException.class) != null) {
S3ErrorCode code = S3ErrorCode.REQUEST_TIMEOUT;
sendSimpleErrorResponse(request, response, code,
code.getMessage(), ImmutableMap.<String, String>of());
baseRequest.setHandled(true);
return;
} else {
throw ioe;
}
} catch (IllegalArgumentException iae) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
baseRequest.setHandled(true);
@ -297,6 +286,17 @@ final class S3ProxyHandler extends AbstractHandler {
response.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED);
baseRequest.setHandled(true);
return;
} catch (Throwable throwable) {
if (Throwables2.getFirstThrowableOfType(throwable,
TimeoutException.class) != null) {
S3ErrorCode code = S3ErrorCode.REQUEST_TIMEOUT;
sendSimpleErrorResponse(request, response, code,
code.getMessage(), ImmutableMap.<String, String>of());
baseRequest.setHandled(true);
return;
} else {
throw throwable;
}
}
}