mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-19 04:45:07 -04:00
S3BlobContainer: Revert broadened exception handler (#126731)
Catching Exception instead of AmazonClientException in copyBlob and executeMultipart led to failures in S3RepositoryAnalysisRestIT due to the injected exceptions getting wrapped in IOExceptions that prevented them from being caught and handled in BlobAnalyzeAction. Closes #126576
This commit is contained in:
parent
2a2491897f
commit
d02b65308e
2 changed files with 2 additions and 5 deletions
|
@ -377,7 +377,7 @@ class S3BlobContainer extends AbstractBlobContainer {
|
|||
SocketAccess.doPrivilegedVoid(() -> { clientReference.client().copyObject(copyRequest); });
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
} catch (final AmazonClientException e) {
|
||||
if (e instanceof AmazonServiceException ase && ase.getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
|
||||
throw new NoSuchFileException(
|
||||
"Copy source [" + s3SourceBlobContainer.buildKey(sourceBlobName) + "] not found: " + ase.getMessage()
|
||||
|
@ -618,7 +618,7 @@ class S3BlobContainer extends AbstractBlobContainer {
|
|||
SocketAccess.doPrivilegedVoid(() -> clientReference.client().completeMultipartUpload(complRequest));
|
||||
}
|
||||
success = true;
|
||||
} catch (final Exception e) {
|
||||
} catch (final AmazonClientException e) {
|
||||
if (e instanceof AmazonServiceException ase && ase.getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
|
||||
throw new NoSuchFileException(blobName, null, e.getMessage());
|
||||
}
|
||||
|
|
|
@ -402,9 +402,6 @@ tests:
|
|||
- class: org.elasticsearch.xpack.esql.action.EsqlActionIT
|
||||
method: testQueryOnEmptyDataIndex
|
||||
issue: https://github.com/elastic/elasticsearch/issues/126580
|
||||
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisRestIT
|
||||
method: testRepositoryAnalysis
|
||||
issue: https://github.com/elastic/elasticsearch/issues/126576
|
||||
- class: org.elasticsearch.xpack.ilm.TimeSeriesDataStreamsIT
|
||||
method: testShrinkActionInPolicyWithoutHotPhase
|
||||
issue: https://github.com/elastic/elasticsearch/issues/126746
|
||||
|
|
Loading…
Add table
Reference in a new issue