mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 09:48:07 +02:00
should probably include a default case, rather than panic-ing (#46)
This commit is contained in:
parent
3c8e5dee9f
commit
8ba3b88a85
@ -47,9 +47,13 @@ func Open(cfg *Config) (*Store, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "error opening database '%v'", cfg.Path)
|
return nil, errors.Wrapf(err, "error opening database '%v'", cfg.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.Errorf("unknown database type '%v' (supported: sqlite3, postgres)", cfg.Type)
|
||||||
}
|
}
|
||||||
logrus.Infof("opened database '%v'", cfg.Path)
|
logrus.Infof("opened database '%v'", cfg.Path)
|
||||||
dbx.MapperFunc(strcase.ToSnake)
|
dbx.MapperFunc(strcase.ToSnake)
|
||||||
|
|
||||||
store := &Store{cfg: cfg, db: dbx}
|
store := &Store{cfg: cfg, db: dbx}
|
||||||
if err := store.migrate(cfg); err != nil {
|
if err := store.migrate(cfg); err != nil {
|
||||||
return nil, errors.Wrapf(err, "error migrating database '%v'", cfg.Path)
|
return nil, errors.Wrapf(err, "error migrating database '%v'", cfg.Path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user