ReactiveX/rxjs

Issue with catchError

NarHakobyan opened this issue · 1 comments

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