File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3 Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -377,12 +377,11 @@ public void copyBlob(
377377 SocketAccess .doPrivilegedVoid (() -> { clientReference .client ().copyObject (copyRequest ); });
378378 }
379379 }
380- } catch (final AmazonClientException e ) {
381- if (e instanceof AmazonS3Exception amazonS3Exception ) {
382- if (amazonS3Exception .getStatusCode () == RestStatus .NOT_FOUND .getStatus ()) {
383- final var sourceKey = s3SourceBlobContainer .buildKey (sourceBlobName );
384- throw new NoSuchFileException ("Copy source [" + sourceKey + "] not found: " + amazonS3Exception .getMessage ());
385- }
380+ } catch (final Exception e ) {
381+ if (e instanceof AmazonServiceException ase && ase .getStatusCode () == RestStatus .NOT_FOUND .getStatus ()) {
382+ throw new NoSuchFileException (
383+ "Copy source [" + s3SourceBlobContainer .buildKey (sourceBlobName ) + "] not found: " + ase .getMessage ()
384+ );
386385 }
387386 throw new IOException ("Unable to copy object [" + blobName + "] from [" + sourceBlobContainer + "][" + sourceBlobName + "]" , e );
388387 }
@@ -619,7 +618,7 @@ private void executeMultipart(
619618 SocketAccess .doPrivilegedVoid (() -> clientReference .client ().completeMultipartUpload (complRequest ));
620619 }
621620 success = true ;
622- } catch (final AmazonClientException e ) {
621+ } catch (final Exception e ) {
623622 if (e instanceof AmazonServiceException ase && ase .getStatusCode () == RestStatus .NOT_FOUND .getStatus ()) {
624623 throw new NoSuchFileException (blobName , null , e .getMessage ());
625624 }
You can’t perform that action at this time.
0 commit comments