Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some operators using util.tryWithObserver passes errors from handlers of the observer ot the observer. #38

Open
naxxster opened this issue Mar 22, 2019 · 0 comments

Comments

@naxxster
Copy link
Contributor

When util.tryWithObserver is used, the scope of error capturing is too wide, so any error from handlers are captured either.

The following example is from the operator all:

    local function onNext(...)
      util.tryWithObserver(observer, function(...)
        if not predicate(...) then
          observer:onNext(false)
          observer:onCompleted()
        end
      end, ...)
    end

In the above case, the util.tryWithObserver function is covering not only the invoke of the predicate function but also covering the invoke of onNext and onComplete of the Observer.

The observable emits errors from onNext of the observer to onError of the Observer even the error is not from the Observable.

I think util.tryWithObserver function should cover only the invoke of function belong to the Observerable itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant