kopia lustrzana https://github.com/gaul/s3proxy
Include cause when throwing S3Exception
rodzic
437ae2068d
commit
76d7bd911d
|
@ -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);
|
||||||
|
|
Ładowanie…
Reference in New Issue