fix: pass full ssh error to browser

This commit is contained in:
Bill Church 2024-08-23 01:19:19 +00:00
parent 3133ad8e97
commit 27d9bfb97e
No known key found for this signature in database
2 changed files with 3 additions and 7 deletions

View file

@ -157,10 +157,8 @@ class WebSSH2Socket extends EventEmitter {
debug(
`initializeConnection: SSH CONNECTION ERROR: ${this.socket.id}, Host: ${creds.host}, Error: ${err.message}`
)
handleError(
new SSHConnectionError(`SSH CONNECTION ERROR: ${err.message}`)
)
this.socket.emit("ssherror", `SSH CONNECTION ERROR: ${err.message}`)
handleError(new SSHConnectionError(`${err.message}`))
this.socket.emit("ssherror", `${err.message}`)
})
}

View file

@ -49,9 +49,7 @@ class SSHConnection extends EventEmitter {
})
this.conn.on("error", err => {
const error = new SSHConnectionError(
`SSH Connection error: ${err.message}`
)
const error = new SSHConnectionError(`${err.message}`)
handleError(error)
reject(error)
})