diff options
author | Andinus <andinus@nand.sh> | 2020-04-05 14:39:19 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-04-05 14:39:19 +0530 |
commit | 0ba76c22e48ca028c8247b990c86297795352085 (patch) | |
tree | 65d7c2dc7aff13aefcd93d14e3bf35a06263ec43 /cmd | |
parent | ec62156564714ebfdc51317236f69886ccf618a6 (diff) | |
download | cetus-0ba76c22e48ca028c8247b990c86297795352085.tar.gz |
Remove ineffectual assignment & log error
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cetus/bpod.go | 10 |
1 files changed, 10 insertions, 0 deletions
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. |