Code Monkey home page Code Monkey logo

Comments (5)

max-mapper avatar max-mapper commented on June 25, 2024

Cc @substack (I will respond in more detail later)

Sent from my iPhone

On May 25, 2013, at 12:18 AM, Jo Liss [email protected] wrote:

The following code:

var concat = require('concat-stream')
var through = require('through')

var stream = through().pause()
stream.pipe(concat(function(data) {}))
stream.emit('error')
throws

stream.js:94
throw er; // Unhandled stream error in pipe.
^
undefined
Before d530532, I believe there would have been an err argument to the callback.

It seems a bit surprising to me to have no err argument to the callback. Is there a nice way to handle errors now? Or should we bring the err argument back maybe?


Reply to this email directly or view it on GitHub.

from concat-stream.

jkroso avatar jkroso commented on June 25, 2024

i'd also like to hear the story behind it

from concat-stream.

max-mapper avatar max-mapper commented on June 25, 2024

sorry about the lag on responding!

so originally I had an err in the callback but @substack convinced me that it was out of scope for this module. For example, add this line to @joliss' example:

stream.on('error', handleError)

all concat-stream does is combine data events, and it itself isn't a stream, so the error event shouldn't propagate. Instead the error handling can just happen in the upstream stream.

gonna close this for now but feel free to re-open if this description isn't logical

from concat-stream.

jkroso avatar jkroso commented on June 25, 2024

I can't say I'm convinced, though handling errors separately isn't hard work I'd be inclined to stick with the older version because its more normal to me

from concat-stream.

joliss avatar joliss commented on June 25, 2024

Hm, I'd be worried that people just forget to attach error handlers. Anyways, I'll defer to your judgment.

from concat-stream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.