Skip to content
This repository was archived by the owner on Mar 21, 2026. It is now read-only.

Commit 90f9325

Browse files
committed
Merge pull request #63 from greggman/master
Make it not fail if it can't find /etc/resolv.conf
2 parents 6ce835d + 8b75198 commit 90f9325

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/platform.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ Platform.prototype.parseResolv = function() {
163163

164164
fs.readFile('/etc/resolv.conf', 'ascii', function(err, file) {
165165
if (err) {
166+
// If the file wasn't found don't worry about it.
167+
if (err.code == 'ENOENT') {
168+
return;
169+
}
166170
throw err;
167171
}
168-
169172
file.split(/\n/).forEach(function(line) {
170173
var i, parts, subparts;
171174
line = line.replace(/^\s+|\s+$/g, '');

0 commit comments

Comments
 (0)