From aa4b421528327881740440c53e7e71e204d95c35 Mon Sep 17 00:00:00 2001 From: idanoo Date: Tue, 13 Sep 2022 19:43:49 +1200 Subject: [PATCH] add error checking --- README.md | 3 +++ internal/flatfinder/utils.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4babd6c..4c46580 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # FlatFinder Bot +[![Build Status](https://ci.tinker.nz/api/badges/idanoo/flat-finder/status.svg)](https://ci.tinker.nz/idanoo/flat-finder) + + * Uses the Trade Me API to grab new rental properties that have been recently listed * Checks if fibre and VDSL are available by querying Chorus * Includes travel times to various locations diff --git a/internal/flatfinder/utils.go b/internal/flatfinder/utils.go index f2e61b3..a266cf5 100644 --- a/internal/flatfinder/utils.go +++ b/internal/flatfinder/utils.go @@ -32,7 +32,10 @@ func (c *LocalConfig) loadConfig() { } // Load it into global - json.Unmarshal(data, c) + err = json.Unmarshal(data, c) + if err != nil { + log.Fatal(err) + } log.Printf("Loaded %d previously posted property IDs", len(c.PostedProperties)) } else {