Round 2
Make Errors a []Error Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
f565d6abb7
commit
00b1e8fca0
13 changed files with 98 additions and 116 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue