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 {
|
try {
|
||||||
if (blobStore.createContainerInLocation(location, containerName,
|
created = blobStore.createContainerInLocation(location,
|
||||||
options)) {
|
containerName, options);
|
||||||
return;
|
} catch (AuthorizationException ae) {
|
||||||
}
|
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_EXISTS, ae);
|
||||||
|
}
|
||||||
|
if (!created) {
|
||||||
S3ErrorCode errorCode = S3ErrorCode.BUCKET_ALREADY_OWNED_BY_YOU;
|
S3ErrorCode errorCode = S3ErrorCode.BUCKET_ALREADY_OWNED_BY_YOU;
|
||||||
sendSimpleErrorResponse(response,
|
sendSimpleErrorResponse(response,
|
||||||
errorCode, errorCode.getMessage(), "BucketName",
|
errorCode, errorCode.getMessage(), "BucketName",
|
||||||
containerName);
|
containerName);
|
||||||
} catch (AuthorizationException ae) {
|
|
||||||
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_EXISTS, ae);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue