Skip to content

Commit

Permalink
fix: pass full ssh error to browser
Browse files Browse the repository at this point in the history
  • Loading branch information
billchurch committed Aug 23, 2024
1 parent 3133ad8 commit 27d9bfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions app/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
})
}

Expand Down
4 changes: 1 addition & 3 deletions app/ssh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down

0 comments on commit 27d9bfb

Please sign in to comment.