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

fix: errors thrown from iterables now properly propagated #5444

Merged
merged 2 commits into from May 18, 2020

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented May 17, 2020

Resolves an issue where if you were trying to use an iterator to do something like examine and flatten an array in one go, it would not properly handle the error, particularly in async cases:

const requestData$: Observable<void> = buttonClicksOrSomething$;

requestData$.pipe(
   concatMap(() => {
      const dataStream$: Observable<Data[]> = getDataStream();

       return dataStream$.pipe(concatMap(function* (rows) {
           for (const row of rows) {
              if (isInvalidRow(row)) {
                  throw new Error('invalid row');
              }
              yield row;
           }
       })
   }
)

Closes #5436

@benlesh benlesh changed the title fix: errors thrown from iterables now properly populated fix: errors thrown from iterables now properly propagated May 17, 2020
Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@benlesh benlesh merged commit 75d4c2f into ReactiveX:master May 18, 2020
benlesh added a commit that referenced this pull request May 18, 2020
* fix: errors thrown from iterables now properly propagated

* chore: fix lint failures

Co-authored-by: Nicholas Jamieson <nicholas@cartant.com>
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not handling errors that occur during iteration in iterator-based inner observables
2 participants