From 7ca5f775455afb0017dd1f33cdec98c1ced6c627 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 28 Sep 2020 16:36:31 -0700 Subject: [PATCH] fix load --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 38ec72a..5723745 100644 --- a/main.go +++ b/main.go @@ -59,13 +59,18 @@ func main() { func load() { _, err := os.Stat(blocklistFile) if os.IsNotExist(err) { + log.Warnf("No blocklistFile: %V\n", err) return } bytes, err := ioutil.ReadFile(blocklistFile) if err != nil { + log.Errorf("Couldn't read blocklist file: %v\n", err) return } - json.Unmarshal(bytes, blocklistedIps) + err = json.Unmarshal(bytes, &blocklistedIps) + if err != nil { + log.Errorf("Couldn't unmarshal blocklisted IPs: %v\n", err) + } return }