File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ def list_labels(self, repo: Repository) -> typing.List[Label]:
69
69
f"{ self .base_url } /repos/{ repo .owner } /{ repo .name } /labels" ,
70
70
headers = {"Accept" : "application/vnd.github.symmetra-preview+json" },
71
71
)
72
+
73
+ if response .status_code != 200 :
74
+ raise GitHubException (
75
+ f"Error retrieving labels: "
76
+ f"{ response .status_code } - "
77
+ f"{ response .reason } "
78
+ )
79
+
72
80
json = response .json ()
73
81
74
82
next_page = response .links .get ('next' , None )
@@ -78,16 +86,17 @@ def list_labels(self, repo: Repository) -> typing.List[Label]:
78
86
next_page ['url' ],
79
87
headers = {"Accept" : "application/vnd.github.symmetra-preview+json" },
80
88
)
89
+
90
+ if response .status_code != 200 :
91
+ raise GitHubException (
92
+ f"Error retrieving next page of labels: "
93
+ f"{ response .status_code } - "
94
+ f"{ response .reason } "
95
+ )
96
+
81
97
json .extend (response .json ())
82
98
next_page = response .links .get ('next' , None )
83
99
84
- if response .status_code != 200 :
85
- raise GitHubException (
86
- f"Error retrieving labels: "
87
- f"{ response .status_code } - "
88
- f"{ response .reason } "
89
- )
90
-
91
100
return [Label (** data ) for data in json ]
92
101
93
102
def get_label (self , repo : Repository , * , name : str ) -> Label :
You can’t perform that action at this time.
0 commit comments