Skip to content

Commit

Permalink
Log write errors from tugboat.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejholmes committed Dec 31, 2015
1 parent 5d9dd0b commit b60190e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions server/github/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package github

import (
"io"
"log"

"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/term"
Expand Down Expand Up @@ -117,14 +116,13 @@ func (d *tugboatDeployer) Deploy(ctx context.Context, p events.Deployment, out i
_, err := d.client.Deploy(ctx, opts, provider(func(ctx context.Context, _ *tugboat.Deployment, w io.Writer) error {
// Write logs to both tugboat as well as the writer we were
// provided (probably stdout).
combined := io.MultiWriter(w, out)
w = io.MultiWriter(w, out)

if err := d.deployer.Deploy(ctx, p, combined); err != nil {
if err := d.deployer.Deploy(ctx, p, w); err != nil {
// If we got a deployment error, write the error to
// tugboat and return tugboat.ErrFailed to indicate the
// failure.
_, werr := io.WriteString(w, err.Error())
log.Printf("write error: %v\n", werr)
io.WriteString(w, err.Error())
return tugboat.ErrFailed
}

Expand Down

0 comments on commit b60190e

Please sign in to comment.