Skip to content

2.x: error handling - exception swallowed after explicit .dispose(). #6025

@yunikkk

Description

@yunikkk

Library verision : 2.1.7

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions