Make Errors a []Error

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis 2015-05-26 17:18:32 -07:00
parent f565d6abb7
commit 00b1e8fca0
13 changed files with 98 additions and 116 deletions

View file

@ -45,7 +45,7 @@ func parseHTTPErrorResponse(r io.Reader) error {
Response: body,
}
}
return &errors
return errors
}
func handleErrorResponse(resp *http.Response) error {
@ -53,9 +53,8 @@ func handleErrorResponse(resp *http.Response) error {
err := parseHTTPErrorResponse(resp.Body)
if uErr, ok := err.(*UnexpectedHTTPResponseError); ok {
return &errcode.Error{
Code: v2.ErrorCodeUnauthorized,
Message: "401 Unauthorized",
Detail: uErr.Response,
Code: v2.ErrorCodeUnauthorized,
Detail: uErr.Response,
}
}
return err