2
在MyWritableStream中發出錯誤事件後,數據傳輸停止。我需要做什麼來恢復數據傳輸?如何在nodejs中的管道流中發生錯誤事件後恢復?
var readable = fs.createReadStream('test.txt');
var writable = new MyWritableStream();
writable.on('error', function(error) {
console.log('error', error);
// How i can resume?
});
writable.on('finish', function(){
console.log('finished');
})
readable.pipe(writable);