Skip to content

Commit aef5630

Browse files
committed
doc: document error event on readline InterfaceConstructor
Aims to document the error event introduced by cb3020d in v16.0.0. Fixes: #58289
1 parent 799feac commit aef5630

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/api/readline.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ The listener function is called without passing any arguments.
102102
The `InterfaceConstructor` instance is finished once the `'close'` event is
103103
emitted.
104104

105+
### Event: `'error'`
106+
107+
<!-- YAML
108+
added: v16.0.0
109+
-->
110+
111+
The `'error'` event is emitted when an error occurs on the `input` stream associated with the `readline` `Interface`.
112+
113+
The listener function is called with an Error object passed as the single argument.
114+
115+
If no `'error'` event handler is attached to the `InterfaceConstructor` instance,
116+
errors will be thrown as unhandled error events, which may crash the process.
117+
105118
### Event: `'line'`
106119

107120
<!-- YAML

0 commit comments

Comments
 (0)