forked from tangled.org/core
Monorepo for Tangled

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
··· 74 74 if incomingUser == "" { 75 75 l.Error("access denied: no user specified") 76 76 fmt.Fprintln(os.Stderr, "access denied: no user specified") 77 - return fmt.Errorf("access denied: no user specified") 77 + os.Exit(-1) 78 78 } 79 79 80 80 sshCommand := os.Getenv("SSH_ORIGINAL_COMMAND") ··· 94 94 if len(cmdParts) < 2 { 95 95 l.Error("invalid command format", "command", sshCommand) 96 96 fmt.Fprintln(os.Stderr, "invalid command format") 97 - return fmt.Errorf("invalid command format") 97 + os.Exit(-1) 98 98 } 99 99 100 100 gitCommand := cmdParts[0] ··· 109 109 if len(components) != 2 { 110 110 l.Error("invalid repo format", "components", components) 111 111 fmt.Fprintln(os.Stderr, "invalid repo format, needs <user>/<repo> or /<user>/<repo>") 112 - return fmt.Errorf("invalid repo format, needs <user>/<repo> or /<user>/<repo>") 112 + os.Exit(-1) 113 113 } 114 114 115 115 didOrHandle := components[0] ··· 134 134 "did", incomingUser, 135 135 "reponame", qualifiedRepoName) 136 136 fmt.Fprintln(os.Stderr, "access denied: user not allowed") 137 - return fmt.Errorf("access denied: user not allowed") 137 + os.Exit(-1) 138 138 } 139 139 } 140 140