Include cause when throwing S3Exception

pull/210/head
Andrew Gaul 2017-04-08 15:33:57 -07:00
rodzic 437ae2068d
commit 76d7bd911d
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -408,8 +408,8 @@ public class S3ProxyHandler {
try { try {
authHeader = new S3AuthorizationHeader(headerAuthorization); authHeader = new S3AuthorizationHeader(headerAuthorization);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException iae) {
throw new S3Exception(S3ErrorCode.INVALID_ARGUMENT); throw new S3Exception(S3ErrorCode.INVALID_ARGUMENT, iae);
} }
requestIdentity = authHeader.identity; requestIdentity = authHeader.identity;
} }
@ -510,7 +510,7 @@ public class S3ProxyHandler {
baseRequest, authHeader, payload, uriForSigning, baseRequest, authHeader, payload, uriForSigning,
credential); credential);
} catch (InvalidKeyException | NoSuchAlgorithmException e) { } catch (InvalidKeyException | NoSuchAlgorithmException e) {
throw new S3Exception(S3ErrorCode.INVALID_ARGUMENT); throw new S3Exception(S3ErrorCode.INVALID_ARGUMENT, e);
} }
} }
@ -1474,7 +1474,8 @@ public class S3ProxyHandler {
try { try {
blob = blobStore.getBlob(containerName, blobName, options); blob = blobStore.getBlob(containerName, blobName, options);
} catch (IllegalArgumentException iae) { } catch (IllegalArgumentException iae) {
throw new S3Exception(S3ErrorCode.INVALID_RANGE); // TODO: correct mapping?
throw new S3Exception(S3ErrorCode.INVALID_RANGE, iae);
} }
if (blob == null) { if (blob == null) {
throw new S3Exception(S3ErrorCode.NO_SUCH_KEY); throw new S3Exception(S3ErrorCode.NO_SUCH_KEY);