forked from TrueCloudLab/neoneo-go
core: return error for unknown storage configuration
This commit is contained in:
parent
35edc26193
commit
fdf73597af
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ package storage
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeyPrefix constants.
|
// KeyPrefix constants.
|
||||||
|
@ -91,6 +92,8 @@ func NewStore(cfg DBConfiguration) (Store, error) {
|
||||||
store, err = NewBoltDBStore(cfg.BoltDBOptions)
|
store, err = NewBoltDBStore(cfg.BoltDBOptions)
|
||||||
case "badgerdb":
|
case "badgerdb":
|
||||||
store, err = NewBadgerDBStore(cfg.BadgerDBOptions)
|
store, err = NewBadgerDBStore(cfg.BadgerDBOptions)
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("unknown storage: %s", cfg.Type)
|
||||||
}
|
}
|
||||||
return store, err
|
return store, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue