mirror of
https://github.com/openziti/zrok.git
synced 2025-02-16 18:20:51 +01: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 {
|
||||
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)
|
||||
dbx.MapperFunc(strcase.ToSnake)
|
||||
|
||||
store := &Store{cfg: cfg, db: dbx}
|
||||
if err := store.migrate(cfg); err != nil {
|
||||
return nil, errors.Wrapf(err, "error migrating database '%v'", cfg.Path)
|
||||
|
Loading…
Reference in New Issue
Block a user