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

toPromise() does not propagate errors properly #683

Open
NoxPhoenix opened this issue Jun 7, 2019 · 3 comments
Open

toPromise() does not propagate errors properly #683

NoxPhoenix opened this issue Jun 7, 2019 · 3 comments

Comments

@NoxPhoenix
Copy link

There are certain situations where the toPromise method will resolve successfully with a highland internal error being thrown.

to recreate...

_([1])
  .map(x => _.nil)
  .toArray(arr => console.log);

Will error Error: Cannot call next after nil

however....

_([1])
  .map(x => _.nil)
  .collect()
  .toPromise(Promise)
  .then(console.log);

Will just log an empty array to the console.

@vqvu
Copy link
Collaborator

vqvu commented Jun 8, 2019 via email

@NoxPhoenix
Copy link
Author

NoxPhoenix commented Jun 8, 2019

Oh ok. I was digging through the code for toPromise and collect to try and find it myself. Good to know you think it's an easy fix!

If you let me know the premise of what needs to be added, I will open a PR for it.

@dvisztempacct
Copy link

This is a bug in map
This is pretty easy to fix

waiting for a PR?

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

3 participants