scope error handling
Co-authored-by: Mislav Marohnić <mislav@github.com>
This commit is contained in:
parent
caa282f0ba
commit
f7b4588d09
1 changed files with 2 additions and 7 deletions
|
|
@ -25,13 +25,8 @@ func deleteRepo(client *http.Client, repo ghrepo.Interface) error {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
err = api.HandleHTTPError(resp)
|
||||
|
||||
if resp.StatusCode == 403 {
|
||||
return fmt.Errorf(`%w
|
||||
Try authorizing the "delete_repo" scope with "gh auth refresh -s delete_repo".`, err)
|
||||
} else if resp.StatusCode > 299 {
|
||||
return err
|
||||
if resp.StatusCode > 299 {
|
||||
return api.HandleHTTPError(resp)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue