Map KeyNotFoundException to NoSuchKey

Unfortunately jclouds inconsistently throws ContainerNotFoundException
and KeyNotFoundException.
pull/101/head
Andrew Gaul 2015-11-20 18:44:14 -08:00
rodzic bc2b18ee2b
commit 22ed1c542c
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -248,6 +248,12 @@ final class S3ProxyHandler extends AbstractHandler {
response.sendError(hre.getResponse().getStatusCode());
baseRequest.setHandled(true);
return;
} catch (KeyNotFoundException knfe) {
S3ErrorCode code = S3ErrorCode.NO_SUCH_KEY;
sendSimpleErrorResponse(request, response, code, code.getMessage(),
ImmutableMap.<String, String>of());
baseRequest.setHandled(true);
return;
} catch (S3Exception se) {
sendSimpleErrorResponse(request, response, se.getError(),
se.getMessage(), se.getElements());