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]:
6969 f"{ self .base_url } /repos/{ repo .owner } /{ repo .name } /labels" ,
7070 headers = {"Accept" : "application/vnd.github.symmetra-preview+json" },
7171 )
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+
7280 json = response .json ()
7381
7482 next_page = response .links .get ('next' , None )
@@ -78,16 +86,17 @@ def list_labels(self, repo: Repository) -> typing.List[Label]:
7886 next_page ['url' ],
7987 headers = {"Accept" : "application/vnd.github.symmetra-preview+json" },
8088 )
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+
8197 json .extend (response .json ())
8298 next_page = response .links .get ('next' , None )
8399
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-
91100 return [Label (** data ) for data in json ]
92101
93102 def get_label (self , repo : Repository , * , name : str ) -> Label :
You can’t perform that action at this time.
0 commit comments