gnodet-bot commented on code in PR #27912:
URL: https://github.com/apache/camel/pull/27912#discussion_r4287506689


##########
dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/FileCliConnectorTransport.java:
##########
@@ -237,18 +264,45 @@ private void finishAction(File request, PendingAction 
action) {
         }
     }
 
-    private static JsonObject loadAction(File file) {
+    /**
+     * The reply to an action: its result, the error, or an ack. The shared 
output file only gets the result, or the
+     * error of an exception (as before 4.24), so the next command does not 
read a reply meant for another command.
+     */
+    private static JsonObject reply(CliActionOutcome outcome, boolean 
replyAlways) {
+        if (outcome.result() != null) {
+            return outcome.result();

Review Comment:
   ⚠️ **Partial result masks exception (file transport only):** `result()` is 
checked first, so if an action sets a partial result *and* then throws, this 
path returns the result and silently drops the error. 
`WebSocketCliConnectorTransport` sends both fields. Unlikely with current 
actions (most do one or the other), but the code path is live via 
`CliActionOutcome.of()`.



##########
dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java:
##########
@@ -1461,8 +1465,12 @@ private void doActionProcessorTask(JsonObject root) {
             } catch (Exception e) {
                 LOG.warn("Error {} processor: {} due to: {}. This exception is 
ignored.", command, mp.getProcessorId(),
                         e.getMessage(), e);
+                reportError("Error " + command + " processor: " + 
mp.getProcessorId() + " due to: " + e.getMessage());

Review Comment:
   ⚠️ **Last-error-wins in loop:** `Collector.error()` is a plain field 
overwrite (`this.error = message`). If multiple processors match the pattern 
and several throw, only the last error is reported to the caller. Low impact in 
practice, but multi-processor failures are silently collapsed. Same pattern 
exists in `doActionRouteTask`.



-- 
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