Issue with catchError
NarHakobyan opened this issue · 1 comments
NarHakobyan commented
Describe the bug
Type declaration of catchError has been changed and caught was marked as required
export function catchError<T, O extends ObservableInput<any>>(
selector: (err: any, caught: Observable<T>) => O
): OperatorFunction<T, T | ObservedValueOf<O>>;
it breaks code where catchError receives only error as argument
Expected behavior
caught must be optional so code like will work
catchError((err: Error) => {
return throwError(
() => err,
);
})
Reproduction code
No response
Reproduction URL
No response
Version
7.8.1
Environment
No response
Additional context
No response
benlesh commented
I'm unable to reproduce this. It seems to work with the latest RxJS and TypeScript: