PublishSubject
is not working with ignoreErrors
function because ignoreErrors
is synonym of retry
. But PublishSubject
can't retry
by contract cause it's not operation.
let subject = PublishSubject<Int>()
_ = subject.ignoreErrors().subscribe(onNext: {
print($0)
})
subject.onNext(1)
subject.onError(RxError.unknown)
subject.onNext(2)
subject.onNext(3)
// output: INFINIRY_LOOP
In this code I can think the sequence can't terminated on error (and yes it's not terminated 😺) but it's not right by contract of Observable
. So I think this operator is mislead and I suggest to remove it.