Permalink
Browse files

always attach error handler (prevents EPIPE errors etc)

  • Loading branch information...
1 parent a26d923 commit d48c1c3306534b34de7c9e2687753dea7fd95718 @maxogden committed Sep 10, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −1 index.js
  2. +1 −1 package.json
View
4 index.js
@@ -6,7 +6,9 @@ function ConcatStream(cb) {
this.writable = true
if (cb) this.cb = cb
this.body = []
- if (this.cb) this.on('error', cb)
+ this.on('error', function(err) {
+ if (this.cb) this.cb(err)
+ })
}
util.inherits(ConcatStream, stream.Stream)
View
2 package.json
@@ -1,7 +1,7 @@
{ "name" : "concat-stream"
, "description" : "writable stream that concatenates strings or data and calls a callback with the result"
, "tags" : ["stream", "simple", "util", "utility"]
-, "version" : "0.0.9"
+, "version" : "0.1.0"
, "author" : "Max Ogden <max@maxogden.com>"
, "repository" :
{ "type" : "git"

0 comments on commit d48c1c3

Please sign in to comment.