Skip to content

Commit c99ef8b

Browse files
author
OpenShift Bot
committed
Merge pull request #486 from bparees/commit_error
Merged by openshift-bot
2 parents c594bf4 + fafcd34 commit c99ef8b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pkg/build/strategies/sti/sti.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func (builder *STI) PostExecute(containerID, location string) error {
326326

327327
imageID, err := builder.docker.CommitContainer(opts)
328328
if err != nil {
329-
return errors.NewBuildError(builder.config.Tag, err)
329+
return errors.NewCommitError(builder.config.Tag, err)
330330
}
331331

332332
builder.result.Success = true

pkg/errors/errors.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ func NewBuildError(name string, err error) error {
117117
}
118118
}
119119

120+
// NewCommitError returns a new error which indicates there was a problem
121+
// committing the image
122+
func NewCommitError(name string, err error) error {
123+
return Error{
124+
Message: fmt.Sprintf("building %s failed when committing the image due to error: %v", name, err),
125+
Details: err,
126+
ErrorCode: BuildError,
127+
Suggestion: "check the build output for errors",
128+
}
129+
}
130+
120131
// NewTarTimeoutError returns a new error which indicates there was a problem
121132
// when sending or receiving tar stream
122133
func NewTarTimeoutError() error {

0 commit comments

Comments
 (0)