Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Squash] Add error code to docs
  • Loading branch information
jasnell committed Sep 5, 2017
commit efd97d2d4af102d54a0779fd933c31640ea5c383
17 changes: 17 additions & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,23 @@ Used when the native call from `process.cpuUsage` cannot be processed properly.

Used when `c-ares` failed to set the DNS server.

<a id="ERR_EVENTS_WHEN_CANCELED"></a>
### ERR_EVENTS_WHEN_CANCELED

Used when a `Promise` created using `emitter.when()` has been rejected because
the listener has been removed.

```js
const EventEmitter = require('events');

const ee = new EventEmitter();
ee.when('foo').then(() => { /* ... */ }).catch((reason) => {
console.log(reason.code); // ERR_EVENTS_WHEN_CANCELED
});

ee.removeAllListeners('foo');
```

<a id="ERR_FALSY_VALUE_REJECTION"></a>
### ERR_FALSY_VALUE_REJECTION

Expand Down