File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,23 @@ Used when the native call from `process.cpuUsage` cannot be processed properly.
614
614
615
615
Used when ` c-ares ` failed to set the DNS server.
616
616
617
+ <a id =" ERR_EVENTS_WHEN_CANCELED " ></a >
618
+ ### ERR_EVENTS_WHEN_CANCELED
619
+
620
+ Used when a ` Promise ` created using ` emitter.when() ` has been rejected because
621
+ the listener has been removed.
622
+
623
+ ``` js
624
+ const EventEmitter = require (' events' );
625
+
626
+ const ee = new EventEmitter ();
627
+ ee .when (' foo' ).then (() => { /* ... */ }).catch ((reason ) => {
628
+ console .log (reason .code ); // ERR_EVENTS_WHEN_CANCELED
629
+ });
630
+
631
+ ee .removeAllListeners (' foo' );
632
+ ```
633
+
617
634
<a id =" ERR_FALSY_VALUE_REJECTION " ></a >
618
635
### ERR_FALSY_VALUE_REJECTION
619
636
You can’t perform that action at this time.
0 commit comments