Skip to content

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

@naxxster

Description

@naxxster

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions