use of org.flyte.api.v1.NodeError in project flytekit-java by flyteorg.
the class ProtoUtilTest method shouldSerializeNodeError.
@Test
void shouldSerializeNodeError() {
NodeError error = NodeError.builder().failedNodeId("node-1").message("Internal error").build();
Types.Error proto = ProtoUtil.serialize(error);
assertThat(proto, equalTo(Types.Error.newBuilder().setFailedNodeId("node-1").setMessage("Internal error").build()));
}
use of org.flyte.api.v1.NodeError in project flytekit-java by flyteorg.
the class SdkBranchNode method toIdl.
@Override
public Node toIdl() {
NodeError nodeError = NodeError.builder().failedNodeId(nodeId).message("No cases matched").build();
Map<String, Binding> extraInputs = new HashMap<>();
@Var IfElseBlock ifElseBlock = IfBlockIdl.toIdl(ifElse, extraInputs);
if (ifElseBlock.elseNode() == null) {
ifElseBlock = ifElseBlock.toBuilder().error(nodeError).build();
}
return Node.builder().id(nodeId).branchNode(BranchNode.builder().ifElse(ifElseBlock).build()).inputs(unmodifiableList(new ArrayList<>(extraInputs.values()))).upstreamNodeIds(upstreamNodeIds).build();
}
Aggregations