Skip to content

Synchronous OnSubscribe Exception Skips Operators #1816

@benjchristensen

Description

@benjchristensen

If an exception is thrown from a synchronous OnSubscribe it will skip the operators such as onErrorResumeNext.

For example:

Observable.create(subscriber -> {
 throw new RuntimeException("failed!");
}).onErrorResumeNext(throwable -> {
    return Observable.just("fallback value");
}).subscribe(System.out::println, t -> System.out.println("ERROR: " + t.getMessage()));

In this case onErrorResumeNext is not called and the error passes through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions