Skip to content
Closed
Show file tree
Hide file tree
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
ERR_SETTING_SERVERS added
  • Loading branch information
sousandrei committed Mar 8, 2017
commit 1607a1961d9474d18603c4e575045423a0ab0128
6 changes: 6 additions & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ a invalid value was passed as an IP to a Node.js API.
The `'ERR_INVALID_PORT'` error code is used generically to identify that
a invalid value was passed as a PORT to a Node.js API.

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

The `'ERR_SETTING_SERVERS'` error code is used generically to identify that
an error occured setting the DNS servers


[`fs.readdir`]: fs.html#fs_fs_readdir_path_options_callback
[`fs.readFileSync`]: fs.html#fs_fs_readfilesync_file_options
Expand Down
3 changes: 1 addition & 2 deletions lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ function setServers(servers) {
cares.setServers(orig.join(','));

var err = cares.strerror(errorNumber);
throw new errors.Error('ERR_ASSERTION',
`c-ares failed to set servers: "${err}" [${servers}]`);
throw new errors.Error('ERR_SETTINGS_SERVERS', err, servers);
}
}

Expand Down
2 changes: 2 additions & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ E('ERR_INVALID_IP',
(arg, ip) => `"${arg}" argument must be a valid IP address, got ${ip}`);
E('ERR_INVALID_PORT',
(arg, port) => `"${arg}" argument must be >= 0 and < 65536, got ${port}`);
E('ERR_SETTING_SERVERS',
(err, servers) => `c-ares failed to set servers: "${err}" [${servers}]`);
// Add new errors from here...

// Errors from 111294, port error from 11302
Copy link
Copy Markdown
Contributor

@mscdex mscdex Mar 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 111294 here should be 11294 instead? Also it's a little bit vague about what this comment is referring to, perhaps it can just be removed?

Expand Down