I want my catch error to return a new LoginFailure action but with a message that comes from the subscription of the translate service. This implementation is giving me:
Argument of type '(error: any) => void' is not assignable to parameter of type '(err: any, caught: Observable) => ObservableInput<{}>'.
@Effect()
login$ = this.actions$.ofType<Login>(AuthActionTypes.Login).pipe(
map(action => action.payload),
exhaustMap(auth =>
this.authService.login(auth).pipe(
map(data => new LoginSuccess({ data: data })),
catchError(error => {
this.translateService
.get('LoginErrorMessage')
.subscribe((res: string) => {
of(new LoginFailure(res));
});
}
)
)
)
);
any help would be appreciated.
return
the new observable in the catchError method. - toskv