You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code will silently swallow thrown exception without signalling to RxPlugins.
val subject = PublishSubject.create<Unit>()
var disposable: Disposable? = null
disposable = subject.subscribe(
{
disposable?.dispose()
throw Exception("test")
}
)
subject.onNext(Unit)
The same applies to BehaviourSubject, *Processor, but not SingleSubject or Observable.just (.range etc. ). Though sections about error handling are almost equal in PublishSubject and SingleSubject.
The reason seems to be located in LambdaObserver, which doesn't signal onError if is disposed already.
Is it expected behaviour?
The text was updated successfully, but these errors were encountered:
Indeed it does not. The tradeoff here is that your code explicitly indicated it doesn't want to handle further events yet there would be no opportunity to have onError not signal to the global error handler.
As for me the exception should still be thrown somewhere, as the code is still executed and doing something wrong. So if .dispose() is requested and onError can not be called - it seems to me that this corresponds 2.x error handling philosophy when the error falls directly into global handler.
Library verision : 2.1.7
The following code will silently swallow thrown exception without signalling to RxPlugins.
The same applies to BehaviourSubject, *Processor, but not SingleSubject or Observable.just (.range etc. ). Though sections about error handling are almost equal in PublishSubject and SingleSubject.
The reason seems to be located in LambdaObserver, which doesn't signal onError if is disposed already.
Is it expected behaviour?
The text was updated successfully, but these errors were encountered: