More if undos.

This commit is contained in:
Satnam Singh 2014-09-24 10:22:13 -07:00
parent 1bdbb73c0e
commit f3c92c381a
3 changed files with 8 additions and 4 deletions

View File

@ -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)
}
})
@ -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)
}

View File

@ -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)
}

View File

@ -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
}