Skip to content

Commit eba9561

Browse files
committed
fix message output
1 parent 9dfa002 commit eba9561

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/serv.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ var (
9797
// fail prints message to stdout, it's mainly used for git serv and git hook commands.
9898
// The output will be passed to git client and shown to user.
9999
func fail(ctx context.Context, userMessage, logMsgFmt string, args ...interface{}) error {
100-
// There appears to be a chance to cause a zombie process and failure to read the Exit status
101-
// if nothing is outputted on stdout.
102100
if userMessage == "" {
103101
userMessage = "Internal Server Error (no user message)"
104102
}
105-
_, _ = fmt.Fprintf(os.Stdout, "\nGitea: %s\n", userMessage)
103+
104+
// There appears to be a chance to cause a zombie process and failure to read the Exit status
105+
// if nothing is outputted on stdout.
106+
_, _ = fmt.Fprintln(os.Stdout, "")
107+
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", userMessage)
106108

107109
if logMsgFmt != "" {
108110
logMsg := fmt.Sprintf(logMsgFmt, args...)

0 commit comments

Comments
 (0)