From 507612bde1fac1a1c6b303f6bcbfcb31ef20eb2e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 1 Jun 2023 16:30:54 +0300 Subject: [PATCH] [#406] cmd/common: Execute PersistentPostRun() on errors Signed-off-by: Evgenii Stratonikov --- cmd/internal/common/exit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/internal/common/exit.go b/cmd/internal/common/exit.go index 9b912ddc0..d38f27e02 100644 --- a/cmd/internal/common/exit.go +++ b/cmd/internal/common/exit.go @@ -46,5 +46,6 @@ func ExitOnErr(cmd *cobra.Command, errFmt string, err error) { } cmd.PrintErrln(err) + cmd.PersistentPostRun(cmd, nil) os.Exit(code) }