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

Unhandled error #16

Open
Eywek opened this issue Apr 9, 2021 · 0 comments
Open

Unhandled error #16

Eywek opened this issue Apr 9, 2021 · 0 comments

Comments

@Eywek
Copy link

Eywek commented Apr 9, 2021

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

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('<message>No Feed.</message>')
  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)

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

1 participant