/tripkit/TripKitAndroid/com.skedgo.rxtry
Package-level declarations
Types
Name | Summary |
---|---|
Failure | data class Failure<T>(error: Throwable) : Try<T> |
Success | data class Success<T>(value: T) : Try<T> |
Try | open class Try<T> |
Functions
Name | Summary |
---|---|
configureInterceptor | fun <T> PublishSubject<T>.configureInterceptor(timeout: Long): Observable<out T> |
printThrowableStackTrace | fun Throwable.printThrowableStackTrace() |
subscribeWithErrorHandling | fun Completable.subscribeWithErrorHandling(onError: (Throwable) -> Unit = { it.printThrowableStackTrace() }, onComplete: () -> Unit = {}): Disposable fun <T : Any> Flowable<T>.subscribeWithErrorHandling(onError: (Throwable) -> Unit = { it.printThrowableStackTrace() }, onSuccess: (T) -> Unit): Disposable fun <T : Any> Observable<T>.subscribeWithErrorHandling(onError: (Throwable) -> Unit = { it.printThrowableStackTrace() }, onNext: (T) -> Unit): Disposable fun <T : Any> Single<T>.subscribeWithErrorHandling(onError: (Throwable) -> Unit = { it.printThrowableStackTrace() }, onSuccess: (T) -> Unit): Disposable |
toTry | fun <T> Observable<T>.toTry(predicate: (Throwable) -> Boolean = { true }): Observable<Try<T>> fun <T> Single<T>.toTry(predicate: (Throwable) -> Boolean = { true }): Single<Try<T>> Wraps any error from the upstream which matches predicate into Failure while events emitted via rx.Observer.onNext will be wrapped into Success. |
toTryObservable | fun <T> toTryObservable(): ObservableTransformer<T, Try<T>> Wraps any error from the upstream into Failure while events emitted via rx.Observer.onNext will be wrapped into Success. fun <T> toTryObservable(predicate: (Throwable) -> Boolean): ObservableTransformer<T, Try<T>> Wraps any error from the upstream which matches predicate into Failure while events emitted via rx.Observer.onNext will be wrapped into Success. |
toTrySingle | fun <T> toTrySingle(): SingleTransformer<T, Try<T>> Wraps any error from the upstream into Failure while events emitted via rx.Observer.onNext will be wrapped into Success. fun <T> toTrySingle(predicate: (Throwable) -> Boolean): SingleTransformer<T, Try<T>> Wraps any error from the upstream which matches predicate into Failure while events emitted via rx.Observer.onNext will be wrapped into Success. |