From 021e17d028038826175d8459c2ccd43c02748ed8 Mon Sep 17 00:00:00 2001 From: Tyler Britten <1933680+tybritten@users.noreply.github.com> Date: Mon, 10 Oct 2022 17:13:24 -0400 Subject: [PATCH] handle unmarshall error --- indexers/contacts.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indexers/contacts.go b/indexers/contacts.go index 3ee1eda..b476af6 100644 --- a/indexers/contacts.go +++ b/indexers/contacts.go @@ -48,7 +48,10 @@ func (i *ContactIndexer) Index(db *sql.DB, rebuild, cleanup bool, shards int, re // doesn't exist or we are rebuilding, create it if physicalIndex == "" || rebuild { - _ = json.Unmarshal(contactsSettingsFile, &contactsSettings) + err = json.Unmarshal(contactsSettingsFile, &contactsSettings) + if err != nil { + return "", errors.Wrap(err, "error unmarshalling embeded contacts.settings.json file") + } contactsSettings.Settings.Index.NumberOfShards = shards contactsSettings.Settings.Index.NumberOfReplicas = replicas physicalIndex, err = i.createNewIndex(contactsSettings)