Skip to content

Commit

Permalink
NIFI-14177 Added Warning Log for Failed HTTP Call to GetWorkdayReport (
Browse files Browse the repository at this point in the history
…#9652)

Co-authored-by: David Handermann <[email protected]>
Signed-off-by: David Handermann <[email protected]>
  • Loading branch information
pvillard31 and exceptionfactory authored Jan 21, 2025
1 parent 5cd52bb commit 922e788
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ private FlowFile createResponseFlowFile(FlowFile flowfile, ProcessSession sessio
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) {
Expand All @@ -325,6 +326,8 @@ private FlowFile createResponseFlowFile(FlowFile flowfile, ProcessSession sessio
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);
Expand Down

0 comments on commit 922e788

Please sign in to comment.