Skip to content

Commit

Permalink
More if undos.
Browse files Browse the repository at this point in the history
  • Loading branch information
satnam6502 committed Sep 24, 2014
1 parent 1bdbb73 commit f3c92c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ var supportedApiVersions map[string]struct{} = map[string]struct{}{

func RegisterHandlers(m manager.Manager) error {
http.HandleFunc(apiResource, func(w http.ResponseWriter, r *http.Request) {
if err := handleRequest(m, w, r); err != nil {
err := handleRequest(m, w, r)
if err != nil {
fmt.Fprintf(w, "%s", err)
}
})
Expand Down Expand Up @@ -170,7 +171,8 @@ func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, er
query.NumStats = 64

decoder := json.NewDecoder(body)
if err := decoder.Decode(&query); err != nil && err != io.EOF {
err := decoder.Decode(&query)
if err != nil && err != io.EOF {
return nil, fmt.Errorf("unable to decode the json value: %s", err)
}

Expand Down
3 changes: 2 additions & 1 deletion manager/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func TestUpdateSubcontainers(t *testing.T) {
nil,
)

if err := cd.updateSubcontainers(); err != nil {
err := cd.updateSubcontainers()
if err != nil {
t.Fatal(err)
}

Expand Down
3 changes: 2 additions & 1 deletion manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ func (self *manager) watchForNewContainers(quit chan error) error {
}

// There is a race between starting the watch and new container creation so we do a detection before we read new containers.
if err := self.detectSubcontainers("/"); err != nil {
err := self.detectSubcontainers("/")
if err != nil {
return err
}

Expand Down

0 comments on commit f3c92c3

Please sign in to comment.