From b74b3c5ffd77cded896a0e8267a0d66207c9832d Mon Sep 17 00:00:00 2001 From: Wes Date: Fri, 20 Dec 2024 18:33:55 -0700 Subject: [PATCH] fix: console dropping some errors messages (#3838) --- frontend/cli/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/cli/main.go b/frontend/cli/main.go index 78bf83ac30..5bed64fb06 100644 --- a/frontend/cli/main.go +++ b/frontend/cli/main.go @@ -128,7 +128,6 @@ func main() { sm := terminal.NewStatusManager(ctx) csm.statusManager = optional.Some(sm) ctx = sm.IntoContext(ctx) - defer sm.Close() } rpc.InitialiseClients(cli.Authenticators, cli.Insecure) @@ -171,7 +170,14 @@ func main() { ctx = bindContext(ctx, kctx) err = kctx.Run(ctx) - kctx.FatalIfErrorf(err) + + if sm, ok := csm.statusManager.Get(); ok { + sm.Close() + } + + if err != nil { + kctx.FatalIfErrorf(err) + } } func createKongApplication(cli any, csm *currentStatusManager) *kong.Kong {