telnet-client
Advanced tools
Comparing version 0.16.4 to 1.0.0
@@ -78,2 +78,3 @@ 'use strict' | ||
this.emit('error', 'Cannot connect') | ||
this.socket.destroy() | ||
@@ -80,0 +81,0 @@ return reject(new Error('Cannot connect')) |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.16.4", | ||
"version": "1.0.0", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "engine": "node >= 6.9.1", |
@@ -39,3 +39,7 @@ [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE) | ||
await connection.connect(params) | ||
try { | ||
await connection.connect(params) | ||
} catch(error) { | ||
// handle the throw (timeout) | ||
} | ||
@@ -104,2 +108,5 @@ let res = await connection.exec('uptime') | ||
}) | ||
.catch(function(error) { | ||
// handle the throw (timeout) | ||
}) | ||
``` | ||
@@ -125,3 +132,7 @@ | ||
co(function*() { | ||
yield connection.connect(params) | ||
try { | ||
yield connection.connect(params) | ||
} catch (error) { | ||
// handle the throw (timeout) | ||
} | ||
@@ -134,3 +145,7 @@ let res = yield connection.exec(cmd) | ||
bluebird.coroutine(function*() { | ||
yield connection.connect(params) | ||
try { | ||
yield connection.connect(params) | ||
} catch (error) { | ||
// handle the throw (timeout) | ||
} | ||
@@ -168,3 +183,7 @@ let res = yield connection.exec(cmd) | ||
await connection.connect(params) | ||
try { | ||
await connection.connect(params) | ||
} catch (error) { | ||
// handle the throw (timeout) | ||
} | ||
@@ -215,2 +234,3 @@ let res = await connection.exec(cmd) | ||
Resolves once the connection is ready (analogous to the ```ready``` event). | ||
Rejects if the timeout is hit. | ||
@@ -217,0 +237,0 @@ ### connection.exec(data, [options], [callback]) -> Promise |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
46918
1
332