Skip to content

Commit 1595d3b

Browse files
committed
Handle HTTP errors in HasScopes
1 parent 77227a6 commit 1595d3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ func (c Client) HasScopes(wantedScopes ...string) (bool, string, error) {
165165
}
166166
defer res.Body.Close()
167167

168+
if res.StatusCode != 200 {
169+
return false, "", handleHTTPError(res)
170+
}
171+
168172
appID := res.Header.Get("X-Oauth-Client-Id")
169173
hasScopes := strings.Split(res.Header.Get("X-Oauth-Scopes"), ",")
170174

0 commit comments

Comments
 (0)