diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java index 9f886bda50..9ec64bb46d 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java @@ -135,7 +135,7 @@ public class CopyS3Object extends AbstractS3Processor { s3.copyObject(request); session.getProvenanceReporter().send(flowFile, getTransitUrl(destinationBucket, destinationKey)); session.transfer(flowFile, REL_SUCCESS); - } catch (final AmazonClientException e) { + } catch (final IllegalArgumentException | AmazonClientException e) { flowFile = extractExceptionDetails(e, session, flowFile); getLogger().error("Failed to copy S3 object from Bucket [{}] Key [{}]", sourceBucket, sourceKey, e); session.transfer(flowFile, REL_FAILURE); diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java index e885b6b56b..303c885fc5 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java @@ -121,7 +121,7 @@ public class DeleteS3Object extends AbstractS3Processor { final DeleteVersionRequest r = new DeleteVersionRequest(bucket, key, versionId); s3.deleteVersion(r); } - } catch (final AmazonServiceException ase) { + } catch (final IllegalArgumentException | AmazonServiceException ase) { flowFile = extractExceptionDetails(ase, session, flowFile); getLogger().error("Failed to delete S3 Object for {}; routing to failure", flowFile, ase); flowFile = session.penalize(flowFile); diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java index 05a5224fac..5189953922 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java @@ -423,7 +423,7 @@ public class FetchS3Object extends AbstractS3Processor { if (metadata.getVersionId() != null) { attributes.put("s3.version", metadata.getVersionId()); } - } catch (final IOException | AmazonClientException ioe) { + } catch (final IllegalArgumentException | IOException | AmazonClientException ioe) { flowFile = extractExceptionDetails(ioe, session, flowFile); getLogger().error("Failed to retrieve S3 Object for {}; routing to failure", flowFile, ioe); flowFile = session.penalize(flowFile); diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java index 9793e81afd..7426a487e5 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java @@ -207,7 +207,7 @@ public class GetS3ObjectMetadata extends AbstractS3Processor { } session.transfer(flowFile, relationship); - } catch (final AmazonClientException e) { + } catch (final IllegalArgumentException | AmazonClientException e) { getLogger().error("Failed to get S3 Object Metadata from Bucket [{}] Key [{}]", bucket, key, e); flowFile = extractExceptionDetails(e, session, flowFile); session.transfer(flowFile, REL_FAILURE); diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java index cd695b4f06..8e69e13fe9 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java @@ -853,7 +853,7 @@ public class PutS3Object extends AbstractS3Processor { getLogger().info("Error trying to delete key {} from cache:", cacheKey, e); } - } catch (final ProcessException | AmazonClientException | IOException e) { + } catch (final IllegalArgumentException | ProcessException | AmazonClientException | IOException e) { extractExceptionDetails(e, session, flowFile); if (e.getMessage().contains(S3_PROCESS_UNSCHEDULED_MESSAGE)) { getLogger().info(e.getMessage()); diff --git a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java index 2de04ef9a8..fe3ac5812c 100644 --- a/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java +++ b/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java @@ -195,7 +195,7 @@ public class TagS3Object extends AbstractS3Processor { r = new SetObjectTaggingRequest(bucket, key, version, new ObjectTagging(tags)); } s3.setObjectTagging(r); - } catch (final AmazonServiceException ase) { + } catch (final IllegalArgumentException | AmazonServiceException ase) { flowFile = extractExceptionDetails(ase, session, flowFile); getLogger().error("Failed to tag S3 Object for {}; routing to failure", flowFile, ase); flowFile = session.penalize(flowFile);