Skip to content

Commit 6a89b50

Browse files
rename ErrorCancellable -> EmptyCancellable for flexibility
1 parent 2d2853a commit 6a89b50

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/Apollo/Cancellable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ extension URLSessionTask: Cancellable {}
1212

1313
// MARK: - Early-Exit Helper
1414

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

1818
// Needs to be public so this can be instantiated outside of the current framework.
1919
public init() {}

Sources/ApolloWebSocket/WebSocketTransport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class WebSocketTransport: NetworkTransport, WebSocketDelegate {
6464
public func send<Operation>(operation: Operation, completionHandler: @escaping (_ response: GraphQLResponse<Operation>?, _ error: Error?) -> Void) -> Cancellable {
6565
if let error = self.error {
6666
completionHandler(nil,error)
67-
return ErrorCancellable()
67+
return EmptyCancellable()
6868
}
6969

7070
return WebSocketTask(self,operation) { (body, error) in

0 commit comments

Comments
 (0)