Skip to content

Bug/ap 25686 try catch rwe error msgs#73

Open
bernd-wiswedel wants to merge 2 commits intomasterfrom
bug/AP-25686_try_catch_rwe_error_msgs
Open

Bug/ap 25686 try catch rwe error msgs#73
bernd-wiswedel wants to merge 2 commits intomasterfrom
bug/AP-25686_try_catch_rwe_error_msgs

Conversation

@bernd-wiswedel
Copy link
Member

No description provided.

@bernd-wiswedel bernd-wiswedel requested a review from a team as a code owner March 1, 2026 20:22
@bernd-wiswedel bernd-wiswedel requested review from Copilot and knime-ghub-bot and removed request for a team and Copilot March 1, 2026 20:22
AP-25686 (When in Try-Catch configuration, Remote Workflow Editor does not show details for Component warning/error messages)
…ors)

AP-25686 (When in Try-Catch configuration, Remote Workflow Editor does not show details for Component warning/error messages)
Copilot AI review requested due to automatic review settings March 9, 2026 14:34
@bernd-wiswedel bernd-wiswedel force-pushed the bug/AP-25686_try_catch_rwe_error_msgs branch from 8c1e14b to 3425b65 Compare March 9, 2026 14:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates node execution status handling to carry structured NodeMessage objects (instead of plain strings), improving error propagation—especially for Try/Catch scopes—and aligns call sites to use the richer message type.

Changes:

  • Add getNodeMessage() to NodeContainerExecutionStatus and introduce newFailure(NodeMessage) (deprecating newFailure(String)).
  • Update Try/Catch error handling to prepend context via NodeMessage rather than stringifying status.
  • Update SubNodeContainer failure creation to preserve the full NodeMessage and add an API tooling filter for the interface change.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
org.knime.core/src/eclipse/org/knime/core/node/workflow/execresult/NodeContainerExecutionStatus.java Adds getNodeMessage() and a NodeMessage-based failure factory; deprecates string-based failure creation.
org.knime.core/src/eclipse/org/knime/core/node/workflow/execresult/NodeContainerExecutionResult.java Marks getNodeMessage() as an override of the new interface method.
org.knime.core/src/eclipse/org/knime/core/node/workflow/SubNodeContainer.java Uses newFailure(NodeMessage) to preserve node messages on failure.
org.knime.core/src/eclipse/org/knime/core/node/workflow/NodeExecutionJob.java Uses status.getNodeMessage() to build Try/Catch failure messages consistently.
org.knime.core/.settings/.api_filters Suppresses API tooling warnings for the internal interface change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 107 to +134
@@ -98,6 +116,12 @@ public NodeContainerExecutionStatus getChildStatus(final int idSuffix) {
return this;
}


@Override
public NodeMessage getNodeMessage() {
return message;
}

/** @return false */
@Override
public boolean isSuccess() {
@@ -107,7 +131,7 @@ public boolean isSuccess() {
/** {@inheritDoc} */
@Override
public String toString() {
return message;
return message.getMessage();
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newFailure(NodeMessage message) assumes message is non-null (used in getNodeMessage() and toString()), but there is no null check. Given the interface contract that getNodeMessage() returns non-null, please enforce non-null here (e.g., requireNonNull / CheckUtils) or normalize null to NodeMessage.NONE (or an ERROR placeholder) to avoid potential NPEs.

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +101
@Deprecated(since = "5.12", forRemoval = true)
static NodeContainerExecutionStatus newFailure(final String message) {
return newFailure(new NodeMessage(NodeMessage.Type.ERROR, message));
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newFailure(String) overload is now deprecated/forRemoval, but this interface still uses it internally (e.g., to initialize the FAILURE constant). To avoid introducing new deprecation warnings (and future breakage once removed), update internal call sites to use newFailure(NodeMessage) directly.

Copilot uses AI. Check for mistakes.
Comment on lines +89 to 92
@Override
public NodeMessage getNodeMessage() {
return m_message;
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getNodeMessage() currently returns m_message directly, but m_message can be null (e.g., if not set yet or if deserialization loads older results without the field). Since NodeContainerExecutionStatus#getNodeMessage() is documented as non-null and callers now invoke methods on it (e.g., prependMessage(...)), please normalize null to NodeMessage.NONE (and consider doing the same in setMessage(...)).

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
75.0% Coverage on New Code (required ≥ 85%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants