Skip to content

Feature request: add onErrorResumeNext #1665

@danhyun

Description

@danhyun

According to https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md we're to file an issue or PR requesting feature additions to RxJS5.

I'd like to have something like onErrorResumeNext http://xgrommx.github.io/rx-book/content/observable/observable_methods/onerrorresumenext.html or the ability to continue with the next emitted item.

In my specific usecase I'm doing something like this:

Rx.Observable.from([1, 2, 3, 4])
  .map(i => {
    if (i == 2) {
       throw new Error('no 2s');
    }
    return i;
  })
  //.onErrorResumeNext(somefunc) // short circuit to subscriber's on error
  .do(i => console.log('map 1: ' + i))
  .map(i => i + 1)
  //.onErrorResumeNext(somefunc) // short circuit to subscriber's on error
  .do(i => console.log('map 2: ' + i))
  .map(i => {
    if (i & 0 == 0) {
      throw new Error('no evens');
    }
    return i * 2;
  })
  .do(i => console.log('map 3: ' + i))
//.onErrorResumeNext(somefunc) // short circuit to subscriber's on error
  .subscribe(
    i => console.log('found ' + i),
    e => console.log('error ' + e),
    () => console.log('done')
  );

Related JSBin http://jsbin.com/monuyegatu/1/edit?html,js,console

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues we wouldn't mind assistance with.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions