Skip to content

Commit

Permalink
Fix dispatching finish block twice
Browse files Browse the repository at this point in the history
  • Loading branch information
kolyasev committed Oct 11, 2017
1 parent 3d86df6 commit 9f11110
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions Sources/SwiftJSONRPC/Client/RPCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ extension ResultDispatcher

fileprivate func dispatch(response: Response)
{
// Dispatch response
switch response.body
{
case .success(let successBody):
Expand All @@ -103,26 +102,17 @@ extension ResultDispatcher
case .error(let error):
dispatchError(InvocationError.rpcError(error: error))
}

// Dispatch invocation finish blocks
dispatchFinish()
}

fileprivate func dispatchSuccessBody(_ body: AnyObject)
{
do {
// Parse result object
let result = try self.invocation.parser.parse(body)

// Dispatch result
dispatchResult(result)
}
catch (let cause)
{
// Init parsing error
let error = InvocationError.applicationError(cause: cause)

// Dispatch error
dispatchError(error)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftJSONRPC/RequestExecutor/RequestExecutor.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------------
//
// RequestManager.swift
// RequestExecutor.swift
//
// @author Denis Kolyasev <[email protected]>
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftJSONRPC/RequestExecutor/RequestId.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------------
//
// Request.swift
// RequestId.swift
//
// @author Denis Kolyasev <[email protected]>
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftJSONRPC/RequestExecutor/Response.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------------
//
// RPCResponse.swift
// Response.swift
//
// @author Denis Kolyasev <[email protected]>
//
Expand Down

0 comments on commit 9f11110

Please sign in to comment.