This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 922e788797 NIFI-14177 Added Warning Log for Failed HTTP Call to 
GetWorkdayReport (#9652)
922e788797 is described below

commit 922e7887978455341e311db1648e1ec473a2a625
Author: Pierre Villard <[email protected]>
AuthorDate: Tue Jan 21 16:02:00 2025 +0100

    NIFI-14177 Added Warning Log for Failed HTTP Call to GetWorkdayReport 
(#9652)
    
    Co-authored-by: David Handermann <[email protected]>
    Signed-off-by: David Handermann <[email protected]>
---
 .../java/org/apache/nifi/processors/workday/GetWorkdayReport.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/nifi-extension-bundles/nifi-workday-bundle/nifi-workday-processors/src/main/java/org/apache/nifi/processors/workday/GetWorkdayReport.java
 
b/nifi-extension-bundles/nifi-workday-bundle/nifi-workday-processors/src/main/java/org/apache/nifi/processors/workday/GetWorkdayReport.java
index f4f3d39c9f..eb317d0f50 100644
--- 
a/nifi-extension-bundles/nifi-workday-bundle/nifi-workday-processors/src/main/java/org/apache/nifi/processors/workday/GetWorkdayReport.java
+++ 
b/nifi-extension-bundles/nifi-workday-bundle/nifi-workday-processors/src/main/java/org/apache/nifi/processors/workday/GetWorkdayReport.java
@@ -309,7 +309,8 @@ public class GetWorkdayReport extends AbstractProcessor {
         throws IOException, SchemaNotFoundException, MalformedRecordException {
         FlowFile responseFlowFile = null;
         try {
-            if (isSuccess(httpResponseEntity.statusCode())) {
+            final int statusCode = httpResponseEntity.statusCode();
+            if (isSuccess(statusCode)) {
                 responseFlowFile = flowfile == null ? session.create() : 
session.create(flowfile);
                 InputStream responseBodyStream = httpResponseEntity.body();
                 if (recordReaderFactoryReference.get() != null) {
@@ -325,6 +326,8 @@ public class GetWorkdayReport extends AbstractProcessor {
                         responseFlowFile = 
session.putAttribute(responseFlowFile, CoreAttributes.MIME_TYPE.key(), 
mimeType.get());
                     }
                 }
+            } else {
+                getLogger().warn("Workday API request failed: HTTP {}", 
statusCode);
             }
         } catch (Exception e) {
             session.remove(responseFlowFile);

Reply via email to