Skip to content

Unhandled error #16

@Eywek

Description

@Eywek

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions