You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by gglanzani <gi...@git.apache.org> on 2017/02/02 15:58:13 UTC
[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by asfgit <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by pvillard31 <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi issue #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by gglanzani <gi...@git.apache.org>.
Github user gglanzani commented on the issue:
https://github.com/apache/nifi/pull/1467
I see the tests are failing here, but seemingly due to the npm registry.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi issue #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by gglanzani <gi...@git.apache.org>.
Github user gglanzani commented on the issue:
https://github.com/apache/nifi/pull/1467
Hi @trixpan thanks for pushing me�to write�the test. It was very informative :)
I've pushed an update. Could you take a look it it's what�you were looking for?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi issue #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on the issue:
https://github.com/apache/nifi/pull/1467
@gglanzani - thank you for the contribution. Code looks great but would it be possible for you to extend the test harness to include a test that will trigger your code(i.e. failure)?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi pull request #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by pvillard31 <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nifi issue #1467: NIFI-3408 Add exception class when InvokeHTTP fails
Posted by gglanzani <gi...@git.apache.org>.
Github user gglanzani commented on the issue:
https://github.com/apache/nifi/pull/1467
Hi @pvillard31 thanks for the review. I've incorporated the�changes.
I've�renamed the two new attributes to `invoke.http.java.exception.{class,message}`.�They reflect better the underlying methods.
Note: I've not�updated the test to test for the message.�I think it would�turn out to be�a pretty�verbose test�BUT let me know in case you disagree :)
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---