kopia lustrzana https://github.com/gaul/s3proxy
Inspect all Throwables for TimeoutException
rodzic
3bfe5302a5
commit
1513606992
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue