nifi-1509 catch recoverable service exceptions explicity

Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/528c4bc5
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/528c4bc5
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/528c4bc5

Branch: refs/heads/master
Commit: 528c4bc59109c5c1c45b67983e0e17bb7be1b8fc
Parents: cd05bed
Author: mans2singh <[email protected]>
Authored: Fri Feb 12 09:22:41 2016 -0800
Committer: mans2singh <[email protected]>
Committed: Fri Feb 12 09:22:41 2016 -0800

----------------------------------------------------------------------
 .../apache/nifi/processors/aws/lambda/PutLambda.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/528c4bc5/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/lambda/PutLambda.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/lambda/PutLambda.java
 
b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/lambda/PutLambda.java
index 9850bd2..e3ff46b 100644
--- 
a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/lambda/PutLambda.java
+++ 
b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/lambda/PutLambda.java
@@ -194,13 +194,19 @@ public class PutLambda extends AbstractAWSLambdaProcessor 
{
                     new Object[]{functionName, unrecoverableException, 
flowFile});
                 flowFile = populateExceptionAttributes(session, flowFile, 
unrecoverableException);
                 session.transfer(flowFile, REL_FAILURE);
-        } catch (final ServiceException | TooManyRequestsException exception) {
+        } catch (final TooManyRequestsException retryableServiceException) {
             getLogger().error("Failed to invoke lambda {} with exception {} 
for flow file {}, therefore penalizing flowfile",
-                new Object[]{functionName, exception, flowFile});
-            flowFile = populateExceptionAttributes(session, flowFile, 
exception);
+                new Object[]{functionName, retryableServiceException, 
flowFile});
+            flowFile = populateExceptionAttributes(session, flowFile, 
retryableServiceException);
             flowFile = session.penalize(flowFile);
             session.transfer(flowFile, REL_FAILURE);
             context.yield();
+        } catch (final AmazonServiceException unrecoverableServiceException) {
+            getLogger().error("Failed to invoke lambda {} with exception {} 
for flow file {} sending to fail",
+                new Object[]{functionName, unrecoverableServiceException, 
flowFile});
+            flowFile = populateExceptionAttributes(session, flowFile, 
unrecoverableServiceException);
+            session.transfer(flowFile, REL_FAILURE);
+            context.yield();
         } catch (final Exception exception) {
             getLogger().error("Failed to invoke lambda {} with exception {} 
for flow file {}",
                 new Object[]{functionName, exception, flowFile});

Reply via email to