Skip to content

Commit

Permalink
Merge pull request #4 from banjun/avoid-early-failure-other-than-2xx
Browse files Browse the repository at this point in the history
Avoid early failure at APIKit when http status code is other than 2xx
  • Loading branch information
banjun committed Nov 19, 2018
2 parents 17409a1 + 39fe05e commit 098fa63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Preamble.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ extension APIBlueprintRequest {
func decodeJSON<T: Decodable>(from object: Any, urlResponse: HTTPURLResponse) throws -> T {
return try JSONDecoder().decode(T.self, from: data(from: object, urlResponse: urlResponse))
}
public func intercept(object: Any, urlResponse: HTTPURLResponse) throws -> Any {
return object
}
}
protocol URITemplateRequest: Request {
Expand Down

0 comments on commit 098fa63

Please sign in to comment.