From b8d46bec0cf68a604b151e8bda84f49eb8c66092 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Mon, 25 Jan 2016 21:54:31 +0100 Subject: [PATCH] Readds `onError` to `Driver` `do` operator because removing it would break API backwards compatibility for 2.0.0. --- RxCocoa/Common/CocoaUnits/Driver/Driver+Operators.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RxCocoa/Common/CocoaUnits/Driver/Driver+Operators.swift b/RxCocoa/Common/CocoaUnits/Driver/Driver+Operators.swift index 02948480..c9d10e23 100644 --- a/RxCocoa/Common/CocoaUnits/Driver/Driver+Operators.swift +++ b/RxCocoa/Common/CocoaUnits/Driver/Driver+Operators.swift @@ -124,15 +124,15 @@ extension DriverConvertibleType { Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence. - parameter onNext: Action to invoke for each element in the observable sequence. - - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. This callback will never be invoked since driver can't error out. - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - returns: The source sequence with the side-effecting behavior applied. */ @warn_unused_result(message="http://git.io/rxs.uo") - public func doOn(onNext onNext: (E -> Void)? = nil, onCompleted: (() -> Void)? = nil) + public func doOn(onNext onNext: (E -> Void)? = nil, onError: (ErrorType -> Void)? = nil, onCompleted: (() -> Void)? = nil) -> Driver { let source = self.asObservable() - .doOn(onNext: onNext, onCompleted: onCompleted) + .doOn(onNext: onNext, onError: onError, onCompleted: onCompleted) return Driver(source) }