toPromise() does not propagate errors properly
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Description
There are certain situations where the toPromise method will resolve successfully with a highland internal error being thrown.
to recreate...
```javascript
_([1])
.map(x => _.nil)
.toArray(arr => console.log);
```
Will error `Error: Cannot call next after nil`
however....
```javascript
_([1])
.map(x => _.nil)
.collect()
.toPromise(Promise)
.then(console.log);
```
Will just log an empty array to the console.
Contributor guide
Research direction
Start by tracing the toPromise and collect entry points using the reproduction in the issue, then compare their error handling with the toArray behavior. Done means the Promise rejects with the Highland internal error instead of resolving with an empty array.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100