[
https://issues.apache.org/jira/browse/NIFI-3408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15854489#comment-15854489
]
ASF GitHub Bot commented on NIFI-3408:
--------------------------------------
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());
````
> Add an attribute for failure reason to InvokeHTTP in all cases to match docs
> ----------------------------------------------------------------------------
>
> Key: NIFI-3408
> URL: https://issues.apache.org/jira/browse/NIFI-3408
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Joseph Percivall
> Priority: Minor
>
> Originally brought up on the mailing list[1], the InvokeHTTP docs state:
> ```
> The original FlowFile will be routed on any type of connection failure,
> timeout or general exception. It will have new attributes detailing the
> request.
> ```
> Adding attributes currently only happens though when a response is received
> from the server, so not attributes if it fails to connect or the socket times
> out.
> These attributes should be added.
> [1]
> http://apache-nifi-users-list.2361937.n4.nabble.com/InvokeHTTP-and-SocketTimeoutException-td743.html
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)