How to stop unsubscribing the observable when error

Solution 1:

You can emit the error object as normal emission and handle error object manually, without triggering unsubscribe()

eventSource.onerror = (event: ErrorEvent) => {
  subscriber.next({error:event});
};

// usage 
listenNotifications().pipe(
   mergeMap(obj=>{
     // pass to downstream when no error 
     if(!obj.error) return of(obj);
     // ...handle your error
     // then return empty
    return empty();
  }),
  map(..... downstream data processing ) 
)