[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails

2017-02-06 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/1467


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails

2017-02-06 Thread pvillard31
Github user pvillard31 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1467#discussion_r99649592
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
 ---
@@ -118,6 +119,8 @@
 public final static String REQUEST_URL = "invokehttp.request.url";
 public final static String TRANSACTION_ID = "invokehttp.tx.id";
 public final static String REMOTE_DN = "invokehttp.remote.dn";
+public final static String EXCEPTION_CLASS = 
"invokehttp.java.exception";
--- End diff --

What do you think about adding an attribute for exception message as well? 
Might be useful in addition to the class name? 
``invokehttp.java.exception.message``?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails

2017-02-06 Thread pvillard31
Github user pvillard31 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/1467#discussion_r99649060
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
 ---
@@ -753,6 +756,9 @@ public void onTrigger(ProcessContext context, 
ProcessSession session) throws Pro
 if (requestFlowFile != null) {
 logger.error("Routing to {} due to exception: {}", new 
Object[]{REL_FAILURE.getName(), e}, e);
 requestFlowFile = session.penalize(requestFlowFile);
+String attributeKey = EXCEPTION_CLASS;
+String attributeValue = e.getClass().getName();
+requestFlowFile = session.putAttribute(requestFlowFile, 
attributeKey, attributeValue);
--- End diff --

Purely stylistic comment: could you simplify to
java
requestFlowFile = session.putAttribute(requestFlowFile, EXCEPTION_CLASS, 
e.getClass().getName());



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails

2017-02-02 Thread gglanzani
GitHub user gglanzani opened a pull request:

https://github.com/apache/nifi/pull/1467

NIFI-3408 Add exception class when InvokeHTTP fails

Hi, 

I think this closes the Jira ticket. I couldn't execute (all) the tests as 
an SMTP tests fails on Windows (in my machine at least), but it fails on the 
master branch and on release 1.1.0 and 1.0.0 so I guess it's not due to the 
changes below.

I also have not added tests related to this. The test suite in 
nifi-standard-processors seemed quite thin, I'm probably missing something.

Disclaimer: I'm a data scientist that writes Python. I'm more than willing 
to learn (and help!) if things are not how they should be.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/gglanzani/nifi master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/1467.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1467






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---