Skip to content

2.x: doOnSubscribe() does not propagate Exception to the onError() #5105

Closed
@arazabishov

Description

@arazabishov

There is a PublishProcessor which calls .doOnSubscribe(checkCondition) operator to perform certain check. checkCondition is intended to throw UnsupportedOperationException, which then has to be propagated to the subscriber down the stream to onError() method. Instead, UndeliverableException is being thrown and process crashes.

publishProcessor
    .filter(() -> { // predicate })
    .observeOn(scheduler)
    .doOnSubscribe(checkCondition)
    .to((sourceFlowable) -> new FancyFlowable(sourceFlowable)))
    .safeSubscribe(subscriber);

P.S. This is a cross-post from stackoverflow. According to the @akarnokd, this is issue of RxJava2's doOnSubscribe().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions