You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: children.go
    path of file: ./repos/cds/engine/api/action
    
    the code of the file until where you have to start completion: package action

import (
	"context"
	"fmt"
	"strings"

	"github.com/go-gorp/gorp"

	"github.com/ovh/cds/sdk"
)

func insertActionChild(db gorp.SqlExecutor, child sdk.Action, actionID int64, execOrder int) error {
	// useful to not save a step_name if it's the same than the default name (for
    
func handleChildrenError(current *sdk.Action, children []sdk.Action) error {
	childrenIDs := current.ToUniqueChildrenIDs()

	if len(children) == len(childrenIDs) {
		return nil
	}

	// construct list of children not found names or ids
	mChildren := make(map[int64]sdk.Action, len(children))
	for i := range children {
		mChildren[children[i].ID] = children[i]
	}

	notFoundChildrenIDs := make([]int64, 0, len(childrenIDs))
	for i := range childrenIDs {
		if _, ok := mChildren[childrenIDs[i]]; !ok {
			notFoundChildrenIDs = append(notFoundChildrenIDs, childrenIDs[i])
		}
	}

	notFoundChildrenRefs := make([]string, len(notFoundChildrenIDs))
	for i := range notFoundChildrenIDs {
		for j := range current.Actions {
			if current.Actions[j].ID == notFoundChildrenIDs[i] {
				if current.Actions[j].Group != nil && current.Actions[j].Name != "" {
					notFoundChildrenRefs[i] = fmt.Sprintf("path: %s/%s", current.Actions[j].Group.Name, current.Actions[j].Name)
				} else {
					notFoundChildrenRefs[i] = fmt.Sprintf("id: %d", current.Actions[j].ID)
				}
			}
		}
	}
	return sdk.NewErrorFrom(sdk.ErrWrongRequest, "some given step actions are not usable: (%s). Please check you have correct permissions on your project and your workflow", strings.Join(notFoundChildrenRefs, ", "))
}