Add ability to pass in substitution args into an Error
Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
2451dd1c32
commit
94e2e9f4a0
5 changed files with 111 additions and 40 deletions
|
@ -52,10 +52,14 @@ func handleErrorResponse(resp *http.Response) error {
|
|||
if resp.StatusCode == 401 {
|
||||
err := parseHTTPErrorResponse(resp.Body)
|
||||
if uErr, ok := err.(*UnexpectedHTTPResponseError); ok {
|
||||
return &errcode.Error{
|
||||
Code: v2.ErrorCodeUnauthorized,
|
||||
Detail: uErr.Response,
|
||||
}
|
||||
return v2.ErrorCodeUnauthorized.WithDetail(uErr.Response)
|
||||
/*
|
||||
return &errcode.Error{
|
||||
Code: v2.ErrorCodeUnauthorized,
|
||||
Message: v2.ErrorCodeUnauthorized.Message(),
|
||||
Detail: uErr.Response,
|
||||
}
|
||||
*/
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue