mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
lt: better error handling
Let node handle the displaying of error and setting exit code.
This commit is contained in:
@@ -27,14 +27,13 @@ var opt = {
|
|||||||
|
|
||||||
lt_client(opt.port, opt, function(err, tunnel) {
|
lt_client(opt.port, opt, function(err, tunnel) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
throw err;
|
||||||
return process.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('your url is: %s', tunnel.url);
|
console.log('your url is: %s', tunnel.url);
|
||||||
|
|
||||||
tunnel.on('error', function(err) {
|
tunnel.on('error', function(err) {
|
||||||
console.error(err);
|
throw err;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user