Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #157 from nodes-ios/hotfix/connection_error_not_de…
Browse files Browse the repository at this point in the history
…tected

If we have a specific error on the serializer pass it on instead of m…
  • Loading branch information
cglarsen authored Jul 13, 2017
2 parents 1c1fc03 + 6330554 commit c961207
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Serpent/Serpent/Classes/Extensions/AlamofireExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ public extension Parser {

internal static func serializer<T>(_ parsingHandler: (( _ data: Any? ) -> T?)?) -> DataResponseSerializer<T> {
return DataResponseSerializer<T> { (request, response, data, error) -> Result<T> in


//If we have an error here - pass it on
if let error = error {
return .failure(error)
}

let result = Request.serializeResponseJSON(options: .allowFragments, response: response, data: data, error: error)

switch result {
Expand Down

0 comments on commit c961207

Please sign in to comment.