-
Notifications
You must be signed in to change notification settings - Fork 160
Bug/ap 25686 try catch rwe error msgs #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ | |
| package org.knime.core.node.workflow.execresult; | ||
|
|
||
| import org.knime.core.node.workflow.NodeID; | ||
| import org.knime.core.node.workflow.NodeMessage; | ||
| import org.knime.core.node.workflow.SingleNodeContainer; | ||
|
|
||
| /** | ||
|
|
@@ -74,6 +75,12 @@ | |
| */ | ||
| public boolean isSuccess(); | ||
|
|
||
| /** The node's message, corresponding to the node's execution status. | ||
| * @return the message, not null. | ||
| * @since 5.12 | ||
| */ | ||
| NodeMessage getNodeMessage(); | ||
|
|
||
| /** Query the execution status for a child given its | ||
| * {@linkplain NodeID#getIndex() node id suffix}. If the child is unknown, | ||
| * the implementation should return {@link #FAILURE}. | ||
|
|
@@ -85,8 +92,19 @@ | |
| /** Convenience shortcut to create failure with no children but custom error message. | ||
| * @param message the message | ||
| * @return a new failure with a custom message. | ||
| * @since 3.0 */ | ||
| static public NodeContainerExecutionStatus newFailure(final String message) { | ||
| * @since 3.0 | ||
| * @deprecated Use {@link #newFailure(NodeMessage)} instead. | ||
| */ | ||
| @Deprecated(since = "5.12", forRemoval = true) | ||
| static NodeContainerExecutionStatus newFailure(final String message) { | ||
|
Check warning on line 99 in org.knime.core/src/eclipse/org/knime/core/node/workflow/execresult/NodeContainerExecutionStatus.java
|
||
| return newFailure(new NodeMessage(NodeMessage.Type.ERROR, message)); | ||
| } | ||
|
Comment on lines
+98
to
+101
|
||
|
|
||
| /** Convenience shortcut to create failure with no children but custom error message. | ||
| * @param message the message | ||
| * @return a new failure with a custom message. | ||
| * @since 5.12 */ | ||
| static NodeContainerExecutionStatus newFailure(final NodeMessage message) { | ||
| return new NodeContainerExecutionStatus() { | ||
|
|
||
| /** | ||
|
|
@@ -98,6 +116,12 @@ | |
| return this; | ||
| } | ||
|
|
||
|
|
||
| @Override | ||
| public NodeMessage getNodeMessage() { | ||
| return message; | ||
| } | ||
|
|
||
| /** @return false */ | ||
| @Override | ||
| public boolean isSuccess() { | ||
|
|
@@ -107,13 +131,13 @@ | |
| /** {@inheritDoc} */ | ||
| @Override | ||
| public String toString() { | ||
| return message; | ||
| return message.getMessage(); | ||
|
Comment on lines
107
to
+134
|
||
| } | ||
| }; | ||
| } | ||
|
|
||
| /** Represents a failed execution. */ | ||
| public static final NodeContainerExecutionStatus FAILURE = newFailure("Failure execution status"); | ||
|
Check warning on line 140 in org.knime.core/src/eclipse/org/knime/core/node/workflow/execresult/NodeContainerExecutionStatus.java
|
||
|
|
||
| /** Represents a successful execution. */ | ||
| public static final NodeContainerExecutionStatus SUCCESS = | ||
|
|
@@ -129,6 +153,11 @@ | |
| return SUCCESS; | ||
| } | ||
|
|
||
| @Override | ||
| public NodeMessage getNodeMessage() { | ||
| return NodeMessage.NONE; | ||
| } | ||
|
|
||
| /** @return true */ | ||
| @Override | ||
| public boolean isSuccess() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getNodeMessage()currently returnsm_messagedirectly, butm_messagecan be null (e.g., if not set yet or if deserialization loads older results without the field). SinceNodeContainerExecutionStatus#getNodeMessage()is documented as non-null and callers now invoke methods on it (e.g.,prependMessage(...)), please normalize null toNodeMessage.NONE(and consider doing the same insetMessage(...)).