kopia lustrzana https://github.com/gaul/s3proxy
Narrow exception handling scope
rodzic
27900bf4de
commit
209f3e60e4
|
@ -750,17 +750,18 @@ final class S3ProxyHandler extends AbstractHandler {
|
|||
}
|
||||
}
|
||||
|
||||
boolean created;
|
||||
try {
|
||||
if (blobStore.createContainerInLocation(location, containerName,
|
||||
options)) {
|
||||
return;
|
||||
created = blobStore.createContainerInLocation(location,
|
||||
containerName, options);
|
||||
} catch (AuthorizationException ae) {
|
||||
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_EXISTS, ae);
|
||||
}
|
||||
if (!created) {
|
||||
S3ErrorCode errorCode = S3ErrorCode.BUCKET_ALREADY_OWNED_BY_YOU;
|
||||
sendSimpleErrorResponse(response,
|
||||
errorCode, errorCode.getMessage(), "BucketName",
|
||||
containerName);
|
||||
} catch (AuthorizationException ae) {
|
||||
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_EXISTS, ae);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue