Add tags implementation

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan
2015-05-08 17:40:30 -07:00
parent da05873b7c
commit d92e5b1096
4 changed files with 98 additions and 25 deletions

View File

@@ -112,3 +112,10 @@ func parseHTTPErrorResponse(response *http.Response) error {
}
return &errors
}
func handleErrorResponse(resp *http.Response) error {
if resp.StatusCode >= 400 && resp.StatusCode < 500 {
return parseHTTPErrorResponse(resp)
}
return &UnexpectedHTTPStatusError{Status: resp.Status}
}