learnyounode
learnyounode copied to clipboard
Challenge 8 HTTP Collect example doesn't support error-first callback for concat-stream
The example in the instructions uses response.pipe(concatStream(function (data) { /* ... */ }))
. Trying to modify this for error handling as a best practice as response.pipe(concatStream(function (err, data) { /* ... */ }))
fails.
This can be simply fixed by changing the instructions/example to use concat-stream-callback
instead of concat-stream
. Thus,
var concatStreamCallback = require('concat-stream-callback');
response.pipe(concatStreamCallback(function (err, data) {/* ... */}))
We'd definitely want to modify the exercise, PR welcome :)