Use the new error package

This is the first step in converting out static strings into well-defined
error types.  This shows just a few examples of it to get a feel for how things
will look. Once we agree on the basic outline we can then work on converting
the rest of the code over.

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis
2015-09-14 13:11:01 -07:00
parent 8e05a3e30f
commit 628b9a41b0
9 changed files with 286 additions and 37 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package server
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
@@ -335,7 +336,7 @@ func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *ht
return err
}
sf := streamformatter.NewJSONStreamFormatter()
w.Write(sf.FormatError(err))
w.Write(sf.FormatError(errors.New(utils.GetErrorMessage(err))))
}
return nil
}