@@ -98,7 +98,7 @@ class Repository {
98
98
99
99
RepositorySlug get slug => new RepositorySlug (owner.login, name);
100
100
101
- Future <List <Issue >> issues ({int limit: 30 }) => github.getJSON ("/repos/${fullName }/issues" , params: { "per_page" : limit }).then ((json) {
101
+ Future <List <Issue >> issues ({int limit: 30 }) => github.getJSON ("/repos/${fullName }/issues" , statusCode : 200 , params: { "per_page" : limit }).then ((json) {
102
102
return json.map ((it) => Issue .fromJSON (github, it));
103
103
});
104
104
@@ -111,7 +111,7 @@ class Repository {
111
111
handle = (GitHub gh, json) {
112
112
if (json is Map ) {
113
113
new Future .delayed (new Duration (milliseconds: 200 ), () {
114
- github.getJSON (path, convert: handle, params: { "per_page" : limit });
114
+ github.getJSON (path, statusCode : 200 , convert: handle, params: { "per_page" : limit });
115
115
});
116
116
return null ;
117
117
} else {
@@ -123,23 +123,23 @@ class Repository {
123
123
}
124
124
125
125
Future <List <Repository >> forks ({int limit: 30 }) {
126
- return github.getJSON ("/repos/${fullName }/forks" , params: { "per_page" : limit }).then ((forks) {
126
+ return github.getJSON ("/repos/${fullName }/forks" , statusCode : 200 , params: { "per_page" : limit }).then ((forks) {
127
127
return copyOf (forks.map ((it) => Repository .fromJSON (github, it)));
128
128
});
129
129
}
130
130
131
131
Future <List <PullRequest >> pullRequests ({int limit: 30 }) {
132
- return github.getJSON ("/repos/${fullName }/pulls" , params: { "per_page" : limit }).then ((List <Map > pulls) {
132
+ return github.getJSON ("/repos/${fullName }/pulls" , statusCode : 200 , params: { "per_page" : limit }).then ((List <Map > pulls) {
133
133
return copyOf (pulls.map ((it) => PullRequest .fromJSON (github, it)));
134
134
});
135
135
}
136
136
137
137
Future <RepositoryPages > pages () {
138
- return github.getJSON ("/repos/${fullName }/pages" , convert: RepositoryPages .fromJSON);
138
+ return github.getJSON ("/repos/${fullName }/pages" , statusCode : 200 , convert: RepositoryPages .fromJSON);
139
139
}
140
140
141
141
Future <List <Hook >> hooks ({int limit: 30 }) {
142
- return github.getJSON ("/repos/${fullName }/hooks" , params: { "per_page" : limit }).then ((hooks) {
142
+ return github.getJSON ("/repos/${fullName }/hooks" , statusCode : 200 , params: { "per_page" : limit }).then ((hooks) {
143
143
return copyOf (hooks.map ((it) => Hook .fromJSON (github, fullName, it)));
144
144
});
145
145
}
0 commit comments