Skip to content

Strange catchError behavior inside of concat #3740

@benlesh

Description

@benlesh

RxJS version: 6.2.0

Code to reproduce:

Try it out on this Stackblitz

import { Observable, of, concat, throwError } from 'rxjs';
import { map, catchError } from 'rxjs/operators';

concat(
  new Observable<string>(o => {
    o.next('first item');
    throw 'lol error';
  }).pipe(
    catchError(err => {
      console.log('caught', err);
      return of('blah');
    })
  ),
  of('this should be played'),
)
.subscribe({
  next(x) { console.log(x); },
  error(err) { console.log(err); },
})

Expected behavior:

Logs

first item
caught
blah
this should be played

Actual behavior:
Logs

first item
lol error

Additional information:

Appears to have to do with the difference in behaviors between when an Observable is lifted, vs when it's not WRT syncErrorThrowable.

Metadata

Metadata

Assignees

Labels

bugConfirmed bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions