Skip to content

Commit 8913af3

Browse files
authored
fix(api): improve the error msg returned to UI (#6275)
1 parent e97f32f commit 8913af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/exportentities/v2/workflow.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ func (e *NodeEntry) processNodeAncestors(name string, w *sdk.Workflow) (bool, er
604604
case 0:
605605
// If there is already a root node, it is impossible have another one
606606
if w.WorkflowData.Node.Name != "" {
607-
return false, fmt.Errorf("invalid node dependencies. %s should have at least one dependency because the workflow already have a root", n.Name)
607+
return false, sdk.NewErrorFrom(sdk.ErrWrongRequest, "invalid node dependencies. %s should have at least one dependency because the workflow already have a root", n.Name)
608608
}
609609
w.WorkflowData.Node = *n
610610
return true, nil

0 commit comments

Comments
 (0)