Unwrap AuthorizationException to ACCESS_DENIED

pull/154/head
Andrew Gaul 2016-08-29 23:02:15 -07:00
rodzic 5c3b4494d2
commit 224bb8b2f6
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -293,6 +293,13 @@ final class S3ProxyHandler extends AbstractHandler {
return;
} catch (Throwable throwable) {
if (Throwables2.getFirstThrowableOfType(throwable,
AuthorizationException.class) != null) {
S3ErrorCode code = S3ErrorCode.ACCESS_DENIED;
sendSimpleErrorResponse(request, response, code,
code.getMessage(), ImmutableMap.<String, String>of());
baseRequest.setHandled(true);
return;
} else if (Throwables2.getFirstThrowableOfType(throwable,
TimeoutException.class) != null) {
S3ErrorCode code = S3ErrorCode.REQUEST_TIMEOUT;
sendSimpleErrorResponse(request, response, code,