From d373fc2759ee9b06197fe4483cad23a802b00ac2 Mon Sep 17 00:00:00 2001 From: Ardit Marku Date: Thu, 17 Oct 2024 19:10:10 +0300 Subject: [PATCH] Properly handle errors for running bootstrap --- cmd/run/cmd.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/run/cmd.go b/cmd/run/cmd.go index d51a3082c..e8b4fc8f6 100644 --- a/cmd/run/cmd.go +++ b/cmd/run/cmd.go @@ -45,9 +45,10 @@ var Cmd = &cobra.Command{ ready := make(chan struct{}) go func() { - err = bootstrap.Run(ctx, cfg, ready) - if err != nil { - panic(err) + if err = bootstrap.Run(ctx, cfg, ready); err != nil { + log.Err(err).Msg("Failed to run bootstrap") + cancel() + os.Exit(1) } }()