diff --git a/lib/x11/auth.js b/lib/x11/auth.js index b9b22c1..c1b7290 100644 --- a/lib/x11/auth.js +++ b/lib/x11/auth.js @@ -67,7 +67,15 @@ module.exports = function( display, host, cb ) } fs.readFile(XAuthorityFile, function (err, data) { - if (err) throw err; + if (err) + { + if (err.code == 'ENOENT') + { + cb('',''); + return; + } + throw err; + } var auth = parseXauth(data); for (cookieNum in auth) @@ -79,8 +87,8 @@ module.exports = function( display, host, cb ) return; } } - throw 'No auth cookie matching display=' + display + ' and host=' + host; - + // throw 'No auth cookie matching display=' + display + ' and host=' + host; + cb( '', '' ); }); } } \ No newline at end of file