learnyounode icon indicating copy to clipboard operation
learnyounode copied to clipboard

Challenge 8 HTTP Collect example doesn't support error-first callback for concat-stream

Open kwhms opened this issue 8 years ago • 1 comments

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) {/* ... */}))

kwhms avatar Aug 26 '16 01:08 kwhms

We'd definitely want to modify the exercise, PR welcome :)

AnshulMalik avatar Aug 29 '17 09:08 AnshulMalik