File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -340,8 +340,8 @@ struct RateLimit: Decodable {
340
340
let count: Int
341
341
let resetUNIXTime: NSTimeInterval
342
342
343
- static func decode (e : Extractor) -> RateLimit? {
344
- return build (self .init )(
343
+ static func decode (e : Extractor) throws -> RateLimit {
344
+ return try build (self .init )(
345
345
e.value ([" rate" , " limit" ]),
346
346
e.value ([" rate" , " reset" ])
347
347
)
@@ -361,7 +361,7 @@ struct GetRateLimitRequest: GitHubRequest {
361
361
}
362
362
363
363
func responseFromObject (object : AnyObject , URLResponse : NSHTTPURLResponse) -> Response? {
364
- return decode (object) // get Response from AnyObject using Himotoki
364
+ return try ? decode (object) // get Response from AnyObject using Himotoki
365
365
}
366
366
}
367
367
```
@@ -371,7 +371,7 @@ Additionally, you can provide default implementation of `responseFromObject(_:UR
371
371
``` swift
372
372
extension GitHubRequest where Self .Response: Decodable , Self .Response == Self .Response.DecodedType {
373
373
func responseFromObject (object : AnyObject , URLResponse : NSHTTPURLResponse) -> Self .Response? {
374
- return decode (object)
374
+ return try ? decode (object)
375
375
}
376
376
}
377
377
```
You can’t perform that action at this time.
0 commit comments