Skip to content

Commit 4989011

Browse files
author
Igor Drozdov
committed
Merge branch 'wc-intern-err' into 'main'
Suppress internal errors in client output See merge request gitlab-org/gitlab-shell!549
2 parents 3038ae4 + 3a8bab4 commit 4989011

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/gitlab-shell/main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import (
55
"os"
66
"reflect"
77

8+
grpccodes "google.golang.org/grpc/codes"
9+
grpcstatus "google.golang.org/grpc/status"
10+
811
"gitlab.com/gitlab-org/labkit/log"
912

1013
shellCmd "gitlab.com/gitlab-org/gitlab-shell/cmd/gitlab-shell/command"
@@ -71,7 +74,9 @@ func main() {
7174

7275
if err := cmd.Execute(ctx); err != nil {
7376
ctxlog.WithError(err).Warn("gitlab-shell: main: command execution failed")
74-
console.DisplayWarningMessage(err.Error(), readWriter.ErrOut)
77+
if grpcstatus.Convert(err).Code() != grpccodes.Internal {
78+
console.DisplayWarningMessage(err.Error(), readWriter.ErrOut)
79+
}
7580
os.Exit(1)
7681
}
7782

0 commit comments

Comments
 (0)