lt: better error handling

Let node handle the displaying of error and setting exit code.
This commit is contained in:
Linus Unnebäck
2014-04-06 18:01:13 +02:00
parent 9487797e02
commit 92caf2f204

View File

@@ -27,14 +27,13 @@ var opt = {
lt_client(opt.port, opt, function(err, tunnel) {
if (err) {
console.error(err);
return process.exit(1);
throw err;
}
console.log('your url is: %s', tunnel.url);
tunnel.on('error', function(err) {
console.error(err);
throw err;
});
});