MCPcopy Create free account
hub / github.com/mscdex/ssh2 / onChannelOpenFailure

Function onChannelOpenFailure

lib/utils.js:7–26  ·  view source on GitHub ↗
(self, recipient, info, cb)

Source from the content-addressed store, hash-verified

5const MAX_CHANNEL = 2 ** 32 - 1;
6
7function onChannelOpenFailure(self, recipient, info, cb) {
8 self._chanMgr.remove(recipient);
9 if (typeof cb !== 'function')
10 return;
11
12 let err;
13 if (info instanceof Error) {
14 err = info;
15 } else if (typeof info === 'object' && info !== null) {
16 err = new Error(`(SSH) Channel open failure: ${info.description}`);
17 err.reason = info.reason;
18 } else {
19 err = new Error(
20 '(SSH) Channel open failure: server closed channel unexpectedly'
21 );
22 err.reason = '';
23 }
24
25 cb(err);
26}
27
28function onCHANNEL_CLOSE(self, recipient, channel, err, dead) {
29 if (typeof channel === 'function') {

Callers 3

connectMethod · 0.85
onCHANNEL_CLOSEFunction · 0.85
constructorMethod · 0.85

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…