Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

friendlier error if you pipe an objectMode stream to a non objectMode stream #5028

Open
maxogden opened this Issue Mar 15, 2013 · 5 comments

Comments

Projects
None yet
5 participants

in 0.10.0 if you .pipe a stream.Readable with objectMode: true to a non objectMode: true stream you get this error:

TypeError: invalid data
    at WriteStream.Socket.write (net.js:580:11)
    at write (_stream_readable.js:547:24)
    at flow (_stream_readable.js:556:7)
    at Readable.pipeOnReadable (_stream_readable.js:588:5)
    at Readable.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:382:10)
    at emitReadable (_stream_readable.js:377:5)
    at readableAddChunk (_stream_readable.js:142:7)
    at Readable.push (_stream_readable.js:112:10)

is there any reason it can't be:

TypeError: object written to non-object stream

?

p.s. I came across this while trying to debug by piping an object stream to process.stdout, which was something I used to do with old streams

codyaray commented Jun 7, 2013

+1

👍

dzuluaga commented May 3, 2015

+1

Owner

jasnell commented May 20, 2015

Definitely still an issue in v0.12 and io.js. Marking as a feature-request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment