Skip to content

Commit 8eb290e

Browse files
authored
Merge pull request SpinlockLabs#82 from kevmoo/issue_foo
Throw an error if an issue is not found
2 parents ffc27b3 + 149ffa8 commit 8eb290e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/src/common/issues_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class IssuesService extends Service {
241241
/// API docs: https://developer.github.com/v3/issues/labels/#get-a-single-label
242242
Future<IssueLabel> getLabel(RepositorySlug slug, String name) {
243243
return _github.getJSON("/repos/${slug.fullName}/labels/${name}",
244-
convert: IssueLabel.fromJSON);
244+
convert: IssueLabel.fromJSON, statusCode: StatusCodes.OK);
245245
}
246246

247247
/// Creates a new label on the specified repository.

lib/src/common/model/issues.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ class IssueLabel {
181181
static IssueLabel fromJSON(input) {
182182
if (input == null) return null;
183183

184+
assert(input['name'] != null);
185+
assert(input['color'] != null);
186+
184187
return new IssueLabel()
185188
..name = input['name']
186189
..color = input['color'];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy