chore: update debug messages
This commit is contained in:
parent
8d515f6a77
commit
6ff58c55f5
2 changed files with 19 additions and 2 deletions
|
@ -191,11 +191,20 @@ class WebSSH2Socket extends EventEmitter {
|
|||
stream.on("data", data => {
|
||||
this.socket.emit("data", data.toString("utf-8"))
|
||||
})
|
||||
stream.stderr.on("data", data => debug(`STDERR: ${data}`))
|
||||
// stream.stderr.on("data", data => debug(`STDERR: ${data}`)) // needed for shell.exec
|
||||
stream.on("close", (code, signal) => {
|
||||
debug("close: SSH Stream closed")
|
||||
this.handleConnectionClose(code, signal)
|
||||
})
|
||||
|
||||
stream.on("end", () => {
|
||||
debug("end: SSH Stream ended")
|
||||
})
|
||||
|
||||
stream.on("error", (err) => {
|
||||
debug("error: SSH Stream error %O", err)
|
||||
})
|
||||
|
||||
this.socket.on("data", data => {
|
||||
stream.write(data)
|
||||
})
|
||||
|
@ -206,7 +215,7 @@ class WebSSH2Socket extends EventEmitter {
|
|||
this.handleResize(data)
|
||||
})
|
||||
})
|
||||
.catch(err => this.handleError("SHELL ERROR", err))
|
||||
.catch(err => this.handleError("createShell: ERROR", err))
|
||||
}
|
||||
|
||||
handleResize(data) {
|
||||
|
|
|
@ -48,6 +48,14 @@ class SSHConnection extends EventEmitter {
|
|||
resolve(this.conn)
|
||||
})
|
||||
|
||||
this.conn.on("end", () => {
|
||||
debug(`connect: end: `)
|
||||
})
|
||||
|
||||
this.conn.on("close", () => {
|
||||
debug(`connect: close: `)
|
||||
})
|
||||
|
||||
this.conn.on("error", err => {
|
||||
const error = new SSHConnectionError(`${err.message}`)
|
||||
handleError(error)
|
||||
|
|
Loading…
Reference in a new issue