Skip to content

Issue with catchError #7450

Closed
Closed
@NarHakobyan

Description

@NarHakobyan

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

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