From d6ac0b2adff4652e1469f4810a0045f151a79944 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Thu, 21 Mar 2024 10:36:55 +0530 Subject: [PATCH] fix: better error messages in self update --- update_check.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update_check.go b/update_check.go index 7d6ab43..f33c05c 100644 --- a/update_check.go +++ b/update_check.go @@ -138,14 +138,14 @@ func startCheckUpdate() (chan bool, chan bool) { log.Fatalf("failed to get novm binary to upgrade: %v", err) } - dst, err := os.OpenFile(novmBin, os.O_WRONLY|os.O_TRUNC, 0750) + src, err := os.Open(tmpDownload) if err != nil { - log.Fatalf("failed to updated binary: %v", err) + log.Fatalf("failed to updated binary (%s): %v", tmpDownload, err) } - src, err := os.Open(tmpDownload) + dst, err := os.OpenFile(novmBin, os.O_WRONLY|os.O_TRUNC, 0750) if err != nil { - log.Fatalf("failed to updated binary: %v", err) + log.Fatalf("failed to updated binary (%s): %v", novmBin, err) } io.Copy(dst, src)