diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2022-01-05 11:01:22 +0000 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2022-01-05 11:01:22 +0000 |
commit | 4989011bedc7c33aa49cdac3c230ae9fdcdb49fd (patch) | |
tree | d4a9b058f6ed29b5f975e758a70f38c80178bfce | |
parent | 3038ae450383e63d9672f1b1d2f27995d2160bbc (diff) | |
parent | 3a8bab437d8d0fd9bfa29bc5edd07ae5903af84d (diff) | |
download | gitlab-shell-4989011bedc7c33aa49cdac3c230ae9fdcdb49fd.tar.gz |
Merge branch 'wc-intern-err' into 'main'
Suppress internal errors in client output
See merge request gitlab-org/gitlab-shell!549
-rw-r--r-- | cmd/gitlab-shell/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/gitlab-shell/main.go b/cmd/gitlab-shell/main.go index a945d0c..693140d 100644 --- a/cmd/gitlab-shell/main.go +++ b/cmd/gitlab-shell/main.go @@ -5,6 +5,9 @@ import ( "os" "reflect" + grpccodes "google.golang.org/grpc/codes" + grpcstatus "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/labkit/log" shellCmd "gitlab.com/gitlab-org/gitlab-shell/cmd/gitlab-shell/command" @@ -71,7 +74,9 @@ func main() { if err := cmd.Execute(ctx); err != nil { ctxlog.WithError(err).Warn("gitlab-shell: main: command execution failed") - console.DisplayWarningMessage(err.Error(), readWriter.ErrOut) + if grpcstatus.Convert(err).Code() != grpccodes.Internal { + console.DisplayWarningMessage(err.Error(), readWriter.ErrOut) + } os.Exit(1) } |