MikeThomsen commented on a change in pull request #3285: NIFI-5987 Fixed issue 
where an invalid query pulled from an attribute…
URL: https://github.com/apache/nifi/pull/3285#discussion_r257333184
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
 ##########
 @@ -149,10 +149,16 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
             }
         }
 
-        final Document query = getQuery(context, session, input );
+        final Document query;
+        try {
+            query = getQuery(context, session, input);
+        } catch (Exception ex) {
+            getLogger().error("Error parsing query.", ex);
+            if (input != null) {
+                session.transfer(input, REL_FAILURE);
+            }
 
-        if (query == null) {
-            return;
+            return; //We need to stop immediately.
 
 Review comment:
   @joewitt any objections with me merging it since @zenfenan can't do it right 
now?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to