Skip to content

Commit 021e17d

Browse files
committed
handle unmarshall error
1 parent 7305e10 commit 021e17d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

indexers/contacts.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ func (i *ContactIndexer) Index(db *sql.DB, rebuild, cleanup bool, shards int, re
4848

4949
// doesn't exist or we are rebuilding, create it
5050
if physicalIndex == "" || rebuild {
51-
_ = json.Unmarshal(contactsSettingsFile, &contactsSettings)
51+
err = json.Unmarshal(contactsSettingsFile, &contactsSettings)
52+
if err != nil {
53+
return "", errors.Wrap(err, "error unmarshalling embeded contacts.settings.json file")
54+
}
5255
contactsSettings.Settings.Index.NumberOfShards = shards
5356
contactsSettings.Settings.Index.NumberOfReplicas = replicas
5457
physicalIndex, err = i.createNewIndex(contactsSettings)

0 commit comments

Comments
 (0)