Skip to content

Commit

Permalink
[Squash] Add error code to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Sep 5, 2017
1 parent c02d332 commit efd97d2
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit efd97d2

Please sign in to comment.