youtube-audio-stream icon indicating copy to clipboard operation
youtube-audio-stream copied to clipboard

don't handle exception client connection remain in pending...

Open stefanocudini opened this issue 4 years ago • 1 comments

With url is an empty string..

I want to close connection to client on url error but it remain in waiting..


const stream = require('youtube-audio-stream')

 	try {
		stream(url).pipe(res)
	}
	catch(e) {

		console.log('error',e);
		res.removeHeader('Transfer-Encoding');
		res.status(400).send('err')
		res.end();
		return
	}

and also thisone dont work..

stream(url).pipe(res).on('error', function(e) {
console.log('error',e);
});

stefanocudini avatar Oct 06 '20 10:10 stefanocudini

@JamesKyburz this row: https://github.com/JamesKyburz/youtube-audio-stream/blob/v0.3.6/index.js#L37 it doesn't seem to work

stefanocudini avatar Oct 06 '20 13:10 stefanocudini