Cannot write to stream after nil (async errors handler)
Open
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Description
I get a Promise rejection `Cannot write to stream after nil` and the stack trace shows `node_modules/highland/lib/index.js:1430:19`. The code is like this, and the Promise rejection happens when `push(e)` happens. How can I fix this code?
```js
await new Promise((resolve, reject) => {
highland(ids)
.map(id => highland(download(id)))
.mergeWithLimit(limit)
.errors(async (e, push) => {
if (cannotContinue(e))) {
push(e)
}
})
.stopOnError(reject)
.done(resolve)
})
```
Contributor guide
Assessment
This issue has not been assessed yet.