Skip to content

Commit d69156a

Browse files
author
bot
committed
Give useful error messages
- when WinRM fails to create a shell, print the actual error message
1 parent 422e792 commit d69156a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

remotemanager/winrm_remotemanager.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package remotemanager
22

33
import (
44
"bytes"
5-
"errors"
65
"fmt"
76
"io"
87
"net"
@@ -43,7 +42,7 @@ func (w *WinRM) CanLoginVM() error {
4342

4443
s, err := winrmClient.CreateShell()
4544
if err != nil {
46-
return errors.New("username and password for given IP is invalid")
45+
return fmt.Errorf("failed to create winrm shell: %s", err)
4746
}
4847
s.Close()
4948

0 commit comments

Comments
 (0)