the following code does not work:
#!/usr/local/opt/node-0.10.24/bin/node
var net = require('net');
try {
socket = net.connect("/tmp/test",function () {
socket.on('error', function(err) {
console.log("err");
});
});
} catch(err) {
console.log("err");
}
If there is a error, how can i catch it? In this example I get an: ENOENT or ECONNREFUSED (mkfifo /tmp/test). Shouldn't it print "err"?