Skip to content

Get current Item in catchError #7277

Closed Answered by demensky
victor-perez asked this question in Q&A
Discussion options

You must be logged in to vote
fromEvent(eventEmitter, 'data')
  .pipe(
    mergeMap((id) =>
      from(someInternalCode(id)).pipe(
        catchError((e) => {
          if (e instanceof Error) {
            console.log(e);
            return of(id).pipe();
          }
          throw e;
        }),
      ),
    ),
  )
  .subscribe();

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@demensky
Comment options

Answer selected by victor-perez
@victor-perez
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants