1 import { Subscriber } from '../Subscriber';
2 import { Subject } from '../Subject';
5 * Determines whether the ErrorObserver is closed or stopped or has a
6 * destination that is closed or stopped - in which case errors will
7 * need to be reported via a different mechanism.
8 * @param observer the observer
10 export function canReportError(observer: Subscriber<any> | Subject<any>): boolean {
12 const { closed, destination, isStopped } = observer as any;
13 if (closed || isStopped) {
15 } else if (destination && destination instanceof Subscriber) {
16 observer = destination;