Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/platform/api/buildplanner/response/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import (
func ProcessBuildError(build *BuildResponse, fallbackMessage string) error {
logging.Debug("ProcessBuildError: build.Type=%s", build.Type)
if build.Type == types.PlanningErrorType {
return processPlanningError(build.Message, build.SubErrors)
return ProcessPlanningError(build.Message, build.SubErrors)
} else if build.Error == nil {
return errs.New(fallbackMessage)
}

return locale.NewInputError("err_buildplanner_build", "Encountered error processing build response")
}

func processPlanningError(message string, subErrors []*BuildExprError) error {
func ProcessPlanningError(message string, subErrors []*BuildExprError) error {
var errs []string
var isTransient bool

Expand Down
7 changes: 7 additions & 0 deletions pkg/platform/model/buildplanner/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ActiveState/cli/pkg/buildscript"
"github.com/ActiveState/cli/pkg/platform/api/buildplanner/request"
"github.com/ActiveState/cli/pkg/platform/api/buildplanner/response"
"github.com/ActiveState/cli/pkg/platform/api/buildplanner/types"
)

func (bp *BuildPlanner) Evaluate(org, project string, script *buildscript.BuildScript) error {
Expand All @@ -31,6 +32,12 @@ func (bp *BuildPlanner) Evaluate(org, project string, script *buildscript.BuildS
if err != nil {
return processBuildPlannerError(err, "Failed to evaluate build expression")
}
if response.IsErrorResponse(resp.Type) {
if resp.Type == types.PlanningErrorType {
return response.ProcessPlanningError(resp.Message, resp.SubErrors)
}
return locale.NewError("err_buildplanner_evaluate", "Encountered error evaluating build plan: {{.V0}}", resp.Message)
}
sessionId = resp.SessionID
if resp.Status != raw.Planning && resp.Status != raw.Started {
return nil
Expand Down