mafintosh / mafintosh/pumpify

Unhandled error

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
252
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Hello, I have an unhandled error with the following code:

```js
const { once, Readable } = require('stream')
const miss = require('mississippi')
const through = require('through')

const createStream = (content) => {
const s = new Readable()
s._read = () => {}
s.push(content)
s.push(null)
return s
}

;(async function () {
const transform = through(function () {
transform.emit('error', new Error('Invalid JSON (Unexpected "m" at position 1 in state STOP)'))
})
const source = createStream('No Feed.')
source.on('error', () => {
console.log('handled')
})
const stream = miss.pipeline.obj(source, transform)
const error = await once(stream, 'error')
console.log(error)
})()

```

Node: `v14.5.0`
through: `2.3.8`
pumpify: `1.5.1`

Note: I've run into this issue while using mississippi,pipeline.obj with JSONStream (see error [here](https://github.com/dominictarr/JSONStream/blob/master/index.js#L142))

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the JavaScript reproduction in the issue with the listed Node, through, and pumpify versions. Trace how the emitted error moves through mississippi.pipeline.obj and compare it with the source error handler; completion would require reproducing the unhandled error and establishing the intended error propagation behavior, which the issue does not specify.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.