diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java index 7aa4c03623e7..1a66e5194fc6 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/CopyS3Object.java @@ -134,7 +134,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session 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-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java index 948da8e43f3a..4a8443b65775 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/DeleteS3Object.java @@ -128,7 +128,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session 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-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java index e9b66f476c3f..e064743d8bd4 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/FetchS3Object.java @@ -286,7 +286,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session 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-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java index b6db73a9e62c..b3838631f07d 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java @@ -207,7 +207,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session } 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-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java index 54a543ed4312..fa6083952728 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/PutS3Object.java @@ -868,7 +868,7 @@ public void process(final InputStream rawIn) throws IOException { } catch (IOException e) { getLogger().info("Error trying to delete key {} from cache", cacheKey, e); } - } catch (final ProcessException | AmazonClientException pe) { + } catch (final IllegalArgumentException | ProcessException | AmazonClientException pe) { extractExceptionDetails(pe, session, flowFile); if (pe.getMessage().contains(S3_PROCESS_UNSCHEDULED_MESSAGE)) { getLogger().info(pe.getMessage()); diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java index 2b10b8a8fd1b..f28c862f587e 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/TagS3Object.java @@ -203,7 +203,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session 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);