From 0ba76c22e48ca028c8247b990c86297795352085 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 5 Apr 2020 14:39:19 +0530 Subject: Remove ineffectual assignment & log error --- cmd/cetus/bpod.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmd') diff --git a/cmd/cetus/bpod.go b/cmd/cetus/bpod.go index 5c3cd36..7aa0a1b 100644 --- a/cmd/cetus/bpod.go +++ b/cmd/cetus/bpod.go @@ -73,6 +73,16 @@ func execBPOD() { log.Println("bpod.go: failed to marshal res to body, not saving cache") } else { err = ioutil.WriteFile(file, []byte(body), 0644) + // Not being able to write to the cache file is a + // small error and the program shouldn't exit but + // should continue after printing the log so that the + // user can investigate it later. + if err != nil { + err = fmt.Errorf("%s%s\n%s", + "bpod.go: failed to write body to file: ", file, + err.Error()) + log.Println(err) + } } // Send a desktop notification if notify flag was passed. -- cgit 1.4.1-2-gfad0