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( debug(
`initializeConnection: SSH CONNECTION ERROR: ${this.socket.id}, Host: ${creds.host}, Error: ${err.message}` `initializeConnection: SSH CONNECTION ERROR: ${this.socket.id}, Host: ${creds.host}, Error: ${err.message}`
) )
handleError( handleError(new SSHConnectionError(`${err.message}`))
new SSHConnectionError(`SSH CONNECTION ERROR: ${err.message}`) this.socket.emit("ssherror", `${err.message}`)
)
this.socket.emit("ssherror", `SSH CONNECTION ERROR: ${err.message}`)
}) })
} }

View file

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