X Tutup
Skip to content

Commit f7b4588

Browse files
meiji163mislav
andauthored
scope error handling
Co-authored-by: Mislav Marohnić <mislav@github.com>
1 parent caa282f commit f7b4588

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkg/cmd/repo/delete/http.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,8 @@ func deleteRepo(client *http.Client, repo ghrepo.Interface) error {
2525
}
2626
defer resp.Body.Close()
2727

28-
err = api.HandleHTTPError(resp)
29-
30-
if resp.StatusCode == 403 {
31-
return fmt.Errorf(`%w
32-
Try authorizing the "delete_repo" scope with "gh auth refresh -s delete_repo".`, err)
33-
} else if resp.StatusCode > 299 {
34-
return err
28+
if resp.StatusCode > 299 {
29+
return api.HandleHTTPError(resp)
3530
}
3631

3732
return nil

0 commit comments

Comments
 (0)
X Tutup