martinzink commented on code in PR #2148:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2148#discussion_r3013622342


##########
libminifi/src/core/ProcessSession.cpp:
##########
@@ -258,14 +258,14 @@ void ProcessSessionImpl::write(core::FlowFile &flow, 
const io::OutputStreamCallb
       throw Exception(FILE_OPERATION_EXCEPTION, "Failed to open flowfile 
content for write");
     }
     const auto callback_result = callback(stream);
-    if (callback_result == MinifiIoStatus::MINIFI_IO_CANCEL) {
-      stream->close();
-      content_session_->remove(claim);
-      claim.reset();
-      return;
-    }
+    if (!callback_result) {
+      if (callback_result.is_cancelled()) {
+        stream->close();
+        content_session_->remove(claim);
+        claim.reset();
+        return;
+      }
 
-    if (callback_result < 0) {
       throw Exception(FILE_OPERATION_EXCEPTION, "Failed to process flowfile 
content");
     }

Review Comment:
   agree, firstly I went with raw std::expected and not a custom class that 
justified this change but than later I moved to custom class and didnt think 
this through a second time
   
   
https://github.com/apache/nifi-minifi-cpp/commit/21f5ece018ff1324ddb15bf6c4bed0c126a127ab#diff-d55088efe0f1ad2a600dba414bfee749c5fb634ab44418146623f892bd6756a4R262-R269



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to