From fdf73597af0571ce503f1053aae80153715c3131 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 24 Aug 2020 19:00:16 +0300 Subject: [PATCH] core: return error for unknown storage configuration --- pkg/core/storage/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/core/storage/store.go b/pkg/core/storage/store.go index a01725453..6c77b425d 100644 --- a/pkg/core/storage/store.go +++ b/pkg/core/storage/store.go @@ -3,6 +3,7 @@ package storage import ( "encoding/binary" "errors" + "fmt" ) // KeyPrefix constants. @@ -91,6 +92,8 @@ func NewStore(cfg DBConfiguration) (Store, error) { store, err = NewBoltDBStore(cfg.BoltDBOptions) case "badgerdb": store, err = NewBadgerDBStore(cfg.BadgerDBOptions) + default: + return nil, fmt.Errorf("unknown storage: %s", cfg.Type) } return store, err }