Skip to content

catchError in effects not working #63

@jmeinlschmidt

Description

@jmeinlschmidt

Which @ngneat/effects-* package(s) are the source of the bug?

effects-ng

Is this a regression?

No

Description

Operator catchError in effects is not working and after throwing an error, the effect stops emitting. Please see full example in stackblitz.

public myEffect = this.createEffectFn(($: Observable<string>) =>
  $.pipe(
    tap((no) => console.log('effect invocation', no)),
    map(() => {
      throw new Error('error here');
    }),
    catchError((e) => {
      console.log('catched', e);
      return of();
    })
  )
);

This is related to #34. I think this applies to effect functions as well, see createEffectFn implementation.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-tvg994?file=src%2Fmain.ts

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

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