forked from tangled.org/core
this repo has no description

guard: remove some more duplicating error logs

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

anirudh.fi 17a86e6a 763b1c5c

verified
Changed files
+4 -4
guard
+4 -4
guard/guard.go
···
if incomingUser == "" {
l.Error("access denied: no user specified")
fmt.Fprintln(os.Stderr, "access denied: no user specified")
-
return fmt.Errorf("access denied: no user specified")
+
os.Exit(-1)
}
sshCommand := os.Getenv("SSH_ORIGINAL_COMMAND")
···
if len(cmdParts) < 2 {
l.Error("invalid command format", "command", sshCommand)
fmt.Fprintln(os.Stderr, "invalid command format")
-
return fmt.Errorf("invalid command format")
+
os.Exit(-1)
}
gitCommand := cmdParts[0]
···
if len(components) != 2 {
l.Error("invalid repo format", "components", components)
fmt.Fprintln(os.Stderr, "invalid repo format, needs <user>/<repo> or /<user>/<repo>")
-
return fmt.Errorf("invalid repo format, needs <user>/<repo> or /<user>/<repo>")
+
os.Exit(-1)
}
didOrHandle := components[0]
···
"did", incomingUser,
"reponame", qualifiedRepoName)
fmt.Fprintln(os.Stderr, "access denied: user not allowed")
-
return fmt.Errorf("access denied: user not allowed")
+
os.Exit(-1)
}
}