fix: sshPkg.Fatal has more nuance #525

Merged
decentral1se merged 1 commits from server-add-error-handler into main 2025-03-23 09:30:26 +00:00
2 changed files with 3 additions and 2 deletions

View File

@ -103,8 +103,7 @@ developer machine. The domain is then set to "default".`,
if _, err := client.New(name, timeout); err != nil {
cleanUp(name)
log.Debugf("ssh %s error: %s", name, sshPkg.Fatal(name, err))
log.Fatalf("can't ssh to %s, make sure \"ssh %s\" works", name, name)
log.Fatalf("ssh %s error: %s", name, sshPkg.Fatal(name, err))
}
if created {

View File

@ -20,6 +20,8 @@ func Fatal(hostname string, err error) error {
return fmt.Errorf("ssh auth: permission denied for %s", hostname)
} else if strings.Contains(out, "Network is unreachable") {
return fmt.Errorf("unable to connect to %s, please check your SSH config", hostname)
} else if strings.Contains(out, "Is the docker daemon running") {
return fmt.Errorf("docker: is the daemon running / your user has docker permissions?")
}
return err