diff options
author | Maciej MaĆecki <me@mmalecki.com> | 2014-08-06 16:53:59 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-09-16 15:32:04 +0400 |
commit | 174f7d2820dcb12f1b4b511840416a03cd65b9cf (patch) | |
tree | eab445a6bfbc9eadc804b7b70ccc17903735bf3e /lib/dns.js | |
parent | 11d57a535c21a64885808afd41612406ff854c69 (diff) | |
download | nodejs-174f7d2820dcb12f1b4b511840416a03cd65b9cf.tar.gz nodejs-174f7d2820dcb12f1b4b511840416a03cd65b9cf.tar.bz2 nodejs-174f7d2820dcb12f1b4b511840416a03cd65b9cf.zip |
dns: include host name in error message if available
This makes errors more readable and similar to FS errors, which also
include file name.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'lib/dns.js')
-rw-r--r-- | lib/dns.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dns.js b/lib/dns.js index c61e6e9fc..4eb34d665 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -38,7 +38,7 @@ function errnoException(err, syscall, hostname) { } var ex = null; if (typeof err === 'string') { // c-ares error code. - ex = new Error(syscall + ' ' + err); + ex = new Error(syscall + ' ' + err + (hostname ? ' ' + hostname : '')); ex.code = err; ex.errno = err; ex.syscall = syscall; |