Skip to content

Commit

Permalink
atc: add log for failing to create plan
Browse files Browse the repository at this point in the history
Signed-off-by: Clara Fu <cfu@pivotal.io>
Co-authored-by: Julia Pu <jpu@pivotal.io>
  • Loading branch information
clarafu and julia-pu committed Nov 19, 2019
1 parent 232f86e commit 837a09e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atc/scheduler/buildstarter.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func (s *buildStarter) tryStartNextPendingBuild(
logger.Error("failed-to-check-if-pipeline-is-paused", err)
return false, err
}

if pipelinePaused {
return false, nil
}
Expand Down Expand Up @@ -176,10 +177,13 @@ func (s *buildStarter) tryStartNextPendingBuild(

plan, err := s.factory.Create(job.Config(), resourceConfigs, resourceTypes, buildInputs)
if err != nil {
logger.Error("failed-to-create-build-plan", err)

// Don't use ErrorBuild because it logs a build event, and this build hasn't started
if err = nextPendingBuild.Finish(db.BuildStatusErrored); err != nil {
logger.Error("failed-to-mark-build-as-errored", err)
}

return false, nil
}

Expand Down

0 comments on commit 837a09e

Please sign in to comment.