diff --git a/src/internal/operators/catchError.ts b/src/internal/operators/catchError.ts index 16c8bbe15d..2e5995ef43 100644 --- a/src/internal/operators/catchError.ts +++ b/src/internal/operators/catchError.ts @@ -4,7 +4,19 @@ import { Observable } from '../Observable'; import { OuterSubscriber } from '../OuterSubscriber'; import { subscribeToResult } from '../util/subscribeToResult'; -import { ObservableInput, OperatorFunction } from '../types'; +import { ObservableInput, OperatorFunction, MonoTypeOperatorFunction } from '../types'; + +export function catchError( + selector: (err: any, caught: Observable) => never +): MonoTypeOperatorFunction; + +export function catchError( + selector: (err: any, caught: Observable) => ObservableInput +): MonoTypeOperatorFunction; + +export function catchError( + selector: (err: any, caught: Observable) => ObservableInput +): OperatorFunction; /** * Catches errors on the observable to be handled by returning a new observable or throwing an error. @@ -63,7 +75,7 @@ import { ObservableInput, OperatorFunction } from '../types'; * catch `selector` function. * @name catchError */ -export function catchError(selector: (err: any, caught: Observable) => ObservableInput): OperatorFunction { +export function catchError(selector: (err: any, caught: Observable) => ObservableInput|never): OperatorFunction { return function catchErrorOperatorFunction(source: Observable): Observable { const operator = new CatchOperator(selector); const caught = source.lift(operator);