'error' 事件


如果在写入或管道数据时发生错误,则会触发 'error' 事件。 监听器回调在调用时传入单个 Error 参数。

The 'error' event is emitted if an error occurred while writing or piping data. The listener callback is passed a single Error argument when called.

The stream is not closed when the 'error' event is emitted unless the autoDestroy option was set to true when creating the stream.