Close SSH even if RPC Close fails

This commit is contained in:
Jose Garcia 2021-09-20 20:35:12 +00:00 committed by GitHub
parent 57d04dc5f0
commit 40886479ae

View file

@ -16,6 +16,7 @@ type Session struct {
// is no longer active.
func (s *Session) Close() error {
if err := s.rpc.Close(); err != nil {
s.ssh.Close() // close SSH and ignore error
return fmt.Errorf("failed to close RPC conn: %w", err)
}