事件:'错误'
【Event: 'error'】
- 类型: <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.】
除非在创建流时将 autoDestroy 选项设置为 false,否则当 'error' 事件被触发时,流将被关闭。
【The stream is closed when the 'error' event is emitted unless the
autoDestroy option was set to false when creating the
stream.】
在“error”之后,除了“close”之外,不应再触发其他事件(包括“error”事件)。
【After 'error', no further events other than 'close' should be emitted
(including 'error' events).】