Skip to content

Commit

Permalink
rename ErrorCancellable -> EmptyCancellable for flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
designatednerd committed Jul 2, 2019
1 parent 2d2853a commit 6a89b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Apollo/Cancellable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ extension URLSessionTask: Cancellable {}

// MARK: - Early-Exit Helper

/// A class to return when an error that should cause us to bail out of something still needs to return `Cancellable`.
public final class ErrorCancellable: Cancellable {
/// A class to return when we need to bail out of something which still needs to return `Cancellable`.
public final class EmptyCancellable: Cancellable {

// Needs to be public so this can be instantiated outside of the current framework.
public init() {}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloWebSocket/WebSocketTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class WebSocketTransport: NetworkTransport, WebSocketDelegate {
public func send<Operation>(operation: Operation, completionHandler: @escaping (_ response: GraphQLResponse<Operation>?, _ error: Error?) -> Void) -> Cancellable {
if let error = self.error {
completionHandler(nil,error)
return ErrorCancellable()
return EmptyCancellable()
}

return WebSocketTask(self,operation) { (body, error) in
Expand Down

0 comments on commit 6a89b50

Please sign in to comment.