Skip to content

Use standard, error-first callbacks #37

@zenflow

Description

@zenflow

Drawn from #15. Let's discuss in a separate issue.

jonathanong on Dec 1, 2013

callback(err, data) - it's a callback, not an event listener, so imo it should have err as the first argument. however, err should always be null since concat-stream should never have any errors (i get #6 (comment)) unless we decide to throw errors when there are crazy typing issues. we can do crazy stuff like check listener.length but i'm not a fan of that either.

substack on Dec 23, 2013

cb(err, data) is annoying if there isn't ever an error. Why not just omit that parameter like it presently is?

jeromew on Jan 13, 2014

[...] don't understand "concat-stream should never have any errors" because shouln't concat-stream handle the errors of the underlying streams to report via cb(err, data) ?

zenflow on June 29, 2015 (just now)

If you pipe a readable stream to this or any other writable stream (with Readable.protototype.pipe), errors will not be piped downstream along with the data.
When using this library, you must handle upstream errors yourself
Besides any upstream errors, there are no other errors to expect.

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